If you're not familiar with the recorder refer to recorder-readme.
If you're looking to be onboarded to the asset-sync workflow to push out the test recordings to Azure/azure-sdk-assets repository, refer to asset-sync-workflow.
| script name | What does it do? |
|---|---|
pnpm install |
Updates dependencies |
pnpm -F {./}... build |
Expected to be run from inside your package(sdk/service-name/package-name). Builds the whole dependency tree. |
| script name | command(usually) |
|---|---|
pnpm test:browser |
dev-tool run test:vitest --browser |
pnpm test:node |
dev-tool run test:vitest |
Expects that you have dev-tool among your devDependencies.
Expects that you have powershell installed.
| script command | What does it do? |
|---|---|
npx dev-tool test-proxy init |
[Only once per package] Generates the assets.json with an empty tag. After init, run test commands such as pnpm test:node to generate test recordings and push them. |
npx dev-tool test-proxy push |
To push the test recordings to the assets repo. |
npx dev-tool test-proxy reset |
Reverts the local changes to recordings and resets to what is currently checked in to the assets repo. This is a destructive operation. |
npx dev-tool test-proxy restore |
Pulls the recordings from the assets repo that are referenced in your assets.json. Typically this will be done automatically when you first run tests in playback if the recordings haven't been downloaded already. But you can run this command in advance if you'd like to download them earlier, for example for offline work. |
| script command | What does it do? |
|---|---|
dev-tool run test:vitest --test-proxy-debug |
Provides helpful test-proxy debug logs that include sanitization modifications for both the central sanitizers and the user-specified ones. |
- Update the vitest.config.ts as follows to include the test file you're interested in.
export default mergeConfig(
{
...viteConfig,
test: {
include: ["test/public/node/analysis.spec.ts"],
},
},
defineConfig({
test: {
testTimeout: 1200000,
hookTimeout: 1200000,
},
}),
);- Set
.onlyon the test you're interested in
it.only("test title...")Run the test command such as pnpm unit-test:node to run the test
pnpm integration-test:node -- --testNamePattern "simple"Reference - Filtering Tests — Introduction to Testing JavaScript with Vitest
pnpm test:node -- test/public/metricsClient.spec.ts