{"_id":"@azure-tools/test-utils-vitest","_rev":"2-d6ebda7115ed0b347f6c96efdc2def2b","name":"@azure-tools/test-utils-vitest","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@azure-tools/test-utils-vitest","version":"1.0.0","keywords":["Azure","cloud","test","framework"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure-tools/test-utils-vitest@1.0.0","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"azure-powershell","email":"xidi@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/test-utils/test-utils/README.md","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"tag":"dev","dist":{"shasum":"b43ab4ac24553b1373c678333ce22dad28127cc1","tarball":"https://registry.npmjs.org/@azure-tools/test-utils-vitest/-/test-utils-vitest-1.0.0.tgz","fileCount":294,"integrity":"sha512-Uk66mlqDyp4Yj3AUpYxvuONIvolWfU+lmKyvxjciTeuaIyjsSklL9OgplJ0Cyi6jYa4kMSl0ZQiuOSIqk+R+Mw==","signatures":[{"sig":"MEUCIQD7yVovvs75SDftdwlnl6vNTVkvZ4LIM1jtRUBO3DajdgIgRJM1dRduHazGRVoxfAj12Rr4J8HRhpcuvXwgW71HkVE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":666481},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"},"project":"../../../tsconfig.src.build.json","dialects":["esm","commonjs"],"selfLink":false,"esmDialects":["browser","react-native"]},"type":"module","_from":"file:M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\38b2abc4-223d-4d9e-b100-7fe454b561e2\\azure-tools-test-utils-vitest\\azure-tools-test-utils-vitest-1.0.0.tgz","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"browser":{"types":"./dist/browser/index.d.ts","default":"./dist/browser/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"},"react-native":{"types":"./dist/react-native/index.d.ts","default":"./dist/react-native/index.js"}},"./package.json":"./package.json"},"scripts":{"lint":"eslint src test","pack":"npm pack 2>&1","test":"npm run test:node && npm run test:browser","build":"npm run clean && dev-tool run build-package","clean":"dev-tool run vendored rimraf --glob dist dist-* types *.tgz *.log","format":"dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint src test --fix --fix-type [problem,suggestion]","test:node":"dev-tool run test:vitest --no-test-proxy","check-format":"dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser","build:samples":"echo Obsolete","test:node:esm":"dev-tool run test:vitest --esm --no-test-proxy","update-snippets":"dev-tool run update-snippets"},"_npmUser":{"name":"microsoft1es","email":"npmjs@microsoft.com"},"sdk-type":"utility","_resolved":"M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\38b2abc4-223d-4d9e-b100-7fe454b561e2\\azure-tools-test-utils-vitest\\azure-tools-test-utils-vitest-1.0.0.tgz","_integrity":"sha512-Uk66mlqDyp4Yj3AUpYxvuONIvolWfU+lmKyvxjciTeuaIyjsSklL9OgplJ0Cyi6jYa4kMSl0ZQiuOSIqk+R+Mw==","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"description":"Test utilities library for the Azure SDK for JavaScript and TypeScript","directories":{},"sideEffects":false,"_nodeVersion":"18.5.0","dependencies":{"tslib":"^2.6.3","vitest":"^3.0.9","@opentelemetry/api":"^1.9.0","@azure/core-tracing":"^1.1.2","@azure/abort-controller":"^2.1.2","@azure/core-rest-pipeline":"^1.16.3","@azure-tools/test-recorder":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.9.0","playwright":"^1.46.0","typescript":"~5.8.2","@types/node":"^20.0.0","@vitest/expect":"^3.0.9","@azure/dev-tool":"^1.0.0","@vitest/browser":"^3.0.9","@vitest/coverage-istanbul":"^3.0.9","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/test-utils-vitest_1.0.0_1754623505296_0.3030419339287813","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-08-08T03:25:05.173Z","modified":"2025-08-26T17:21:58.899Z","1.0.0":"2025-08-08T03:25:05.488Z"},"bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"author":{"name":"Microsoft Corporation"},"license":"MIT","homepage":"https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/test-utils/test-utils/README.md","keywords":["Azure","cloud","test","framework"],"repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"description":"Test utilities library for the Azure SDK for JavaScript and TypeScript","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"azure-powershell","email":"xidi@microsoft.com"}],"readme":"# Azure test-utils client library for JavaScript\n\nThe Azure SDK for JavaScript is composed of a multitude of repositories that attempt to deliver a common, homogenous SDK to make use of all the services that Azure can provide.\n\nThis non-shipping library `@azure-tools/test-utils-vitest` attempts to add additional testing support to libraries. It is supposed to be added only as a devDependency and should be used only for the tests of an SDK library.\n\n## Getting started\n\nWe're about to go through how to set up your project to use the `@azure/test-utils-vitest` package.\n\nThis document assumes familiarity with [git](https://git-scm.com) and [pnpm](https://pnpm.io/).\nYou can read more about how we use pnpm in the following links:\n\n- pnpm used for [Project Orchestration](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md#project-orchestration).\n- [pnpm for NPM users](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md#pnpm-for-npm-users).\n\nKeep in mind that `@azure/test-utils-vitest` is not a published package. It is only intended\nto be used by the libraries in the `Azure/azure-sdk-for-js` repository and its forks.\n\n### Installing the package\n\nTo install the `@azure/test-utils-vitest` package, you'll need to start by cloning our\n`azure-sdk-for-js` repository. One way of doing this is by using the git command line interface, as\nfollows:\n\n```bash\ncd /path/to/my/github/repositories\ngit clone https://github.com/Azure/azure-sdk-for-js/\n```\n\nHaving cloned this repository, let's set it up by running the following pnpm commands:\n\n```bash\ncd azure-sdk-for-js\npnpm install\npnpm build\n```\n\nThis will optimistically assume you're in a fresh clone.\n\nFrom this point forward, we'll assume that you're developing (perhaps contributing!) to one of the\n`azure-sdk-for-js`'s libraries. So, your next step is to change directory to the path relevant to\nyour project. Let's say you want to add the `@azure/test-utils-vitest` package to\n`@azure/keyvault-keys`, you'll be doing the following:\n\n```bash\ncd sdk/keyvault/keyvault-keys\n```\n\nOnce there, you can add the `test-utils` package by changing your package.json\nto include the following line in the `devDependencies` section:\n\n```json\n{\n  // ... your package.json properties\n  \"devDependencies\": {\n    // ... your devDependencies\n    \"@azure/test-utils-vitest\": \"^1.0.0\",\n    // ... more of your devDependencies\n  },\n  // ... more of your package.json properties\n}\n```\n\nAfter that, we recommend you to update pnpm and install the dependencies again, as follows:\n\n```bash\npnpm install\n```\n\n## Key concepts\n\n\n### Custom Testing Matrix\n\nMost Azure SDK for JavaScript libraries support multiple methods of authentication. The `@azure/test-utils-vitest` library attempts to add testing support for writing a single test suite then running your suite multiple times based on a provided testing matrix. The most common usage is to construct your client with a different authentication method for test runs.\n\n## Examples\n\n### Import functions\n\n<!-- dev-tool snippets ignore -->\n\n```javascript\nimport { matrix } from \"@azure/test-utils-vitest\";\n```\n\n### Wrap top-level test suite to run test matrix\n\nWrap the top level `describe` of a test file to run the suite with the provided values.\n\n```typescript\nmatrix(\n  [\n    [true, false],\n    [1, 2, 3]\n  ] as const,\n  (enabled: boolean, attempts: number) => {\n    describe(`Run with flag ${enabled ? \"\" : \"not \"}enabled and ${attempts} attempts`, () => {\n      // ...\n    });\n  }\n);\n```\n\n`matrix` takes a jagged 2D array and a function. It then runs this function with every possible combination of elements of each of the arrays. The example above will therefore generate 6 different test suites based on the values passed.\n\n## Troubleshooting\n\nBesides the usual debugging of your code and tests, if you ever encounter a problem, please follow\nup the [contributing](#contributing) guidelines on how to write an issue for us. We'll make sure to\nhandle it as soon as we find the time.\n\n## Next steps\n\nCheck out the [source folder](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/test-utils-vitest/src/) and the [test folder](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/test-utils-vitest/test/).\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.\n","readmeFilename":"README.md"}