Skip to content

Commit

Permalink
test: use yarn g:vitest to run vitest in individual packages (#6665)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe authored Nov 14, 2024
1 parent ace5bf8 commit 361a738
Show file tree
Hide file tree
Showing 93 changed files with 261 additions and 258 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ sync:
make -f Makefile.private.mk sync

test-unit: build-s3-browser-bundle
npx vitest run -c vitest.config.ts
npx vitest run -c vitest.config.browser.ts
npx vitest run -c vitest.config.clients.unit.ts
yarn g:vitest run -c vitest.config.ts
yarn g:vitest run -c vitest.config.browser.ts
yarn g:vitest run -c vitest.config.clients.unit.ts
npx jest -c jest.config.js

test-protocols: build-s3-browser-bundle
npx vitest run -c vitest.config.protocols.integ.ts
yarn g:vitest run -c vitest.config.protocols.integ.ts

test-integration: build-s3-browser-bundle
rm -rf ./clients/client-sso/node_modules/\@smithy # todo(yarn) incompatible redundant nesting.
npx vitest run -c vitest.config.integ.ts
yarn g:vitest run -c vitest.config.integ.ts
npx jest -c jest.config.integ.js
make test-protocols;

test-e2e: build-s3-browser-bundle
npx vitest run -c vitest.config.e2e.ts --retry=4
npx vitest run -c vitest.config.browser.e2e.ts --retry=4
yarn g:vitest run -c vitest.config.e2e.ts --retry=4
yarn g:vitest run -c vitest.config.browser.e2e.ts --retry=4

build-s3-browser-bundle:
node ./clients/client-s3/test/browser-build/esbuild
Expand Down
4 changes: 2 additions & 2 deletions clients/client-cognito-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo cognito-identity",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-eventbridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo eventbridge",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-kinesis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo kinesis",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-lex-runtime-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo lex-runtime-service",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-mediastore-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo mediastore-data",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-s3-control/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo s3-control",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions clients/client-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo s3",
"test": "vitest run",
"test": "yarn g:vitest run",
"test:browser": "node ./test/browser-build/esbuild && vitest run -c vitest.config.browser.ts --mode development",
"test:browser:watch": "node ./test/browser-build/esbuild && vitest watch -c vitest.config.browser.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development && yarn test:browser",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts",
"test:watch": "vitest watch"
"test:browser:watch": "node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.ts",
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development && yarn test:browser",
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-sts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo sts",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-transcribe-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo transcribe-streaming",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions lib/lib-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "vitest watch",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
"test": "yarn g:vitest run",
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "yarn g:vitest watch",
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts"
},
"engines": {
"node": ">=16.0.0"
Expand Down
8 changes: 4 additions & 4 deletions lib/lib-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "vitest watch",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
"test": "yarn g:vitest run",
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "yarn g:vitest watch",
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts"
},
"engines": {
"node": ">=16.0.0"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"clear-build-info": "rimraf ./packages/**/*.tsbuildinfo ./clients/**/*.tsbuildinfo ./lib/**/*.tsbuildinfo ./private/**/*.tsbuildinfo",
"copy-models": "node ./scripts/copy-models",
"extract:docs": "node ./scripts/extract-docs/index.js",
"g:vitest": "cd $INIT_CWD && vitest",
"generate-clients": "node ./scripts/generate-clients",
"generate:clients:generic": "node ./scripts/generate-clients/generic",
"generate:defaults-mode-provider": "./scripts/generate-defaults-mode-provider/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/body-checksum-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/body-checksum-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/chunked-stream-reader-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudfront-signer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"lint": "node ./scripts/lint.js",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:integration": "vitest run -c vitest.config.integ.ts",
"test:watch": "vitest watch",
"test:integration:watch": "vitest watch -c vitest.config.integ.ts"
"test": "yarn g:vitest run",
"test:integration": "yarn g:vitest run -c vitest.config.integ.ts",
"test:watch": "yarn g:vitest watch",
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.ts"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/credential-provider-cognito-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run && yarn test:browser",
"test:watch": "vitest watch",
"test:browser": "vitest run -c vitest.config.browser.ts",
"test:browser:watch": "vitest watch -c vitest.config.browser.ts"
"test": "yarn g:vitest run && yarn test:browser",
"test:watch": "yarn g:vitest watch",
"test:browser": "yarn g:vitest run -c vitest.config.browser.ts",
"test:browser:watch": "yarn g:vitest watch -c vitest.config.browser.ts"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-provider-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"keywords": [
"aws",
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-provider-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"keywords": [
"aws",
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-provider-ini/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"keywords": [
"aws",
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-provider-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test": "yarn g:vitest run",
"test:integration": "jest -c jest.config.integ.js",
"test:watch": "vitest watch"
"test:watch": "yarn g:vitest watch"
},
"keywords": [
"aws",
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-provider-process/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"keywords": [
"aws",
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-provider-sso/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"keywords": [
"aws",
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-provider-web-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"browser": {
"./dist-cjs/fromTokenFile": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test": "yarn g:vitest run",
"test:integration": "jest -c jest.config.integ.js",
"test:watch": "vitest watch"
"test:watch": "yarn g:vitest watch"
},
"keywords": [
"aws",
Expand Down
8 changes: 4 additions & 4 deletions packages/ec2-metadata-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run --passWithNoTests",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "vitest watch --passWithNoTests",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
"test": "yarn g:vitest run --passWithNoTests",
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "yarn g:vitest watch --passWithNoTests",
"test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.ts"
},
"author": {
"name": "AWS SDK for JavaScript Team",
Expand Down
4 changes: 2 additions & 2 deletions packages/endpoint-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"author": {
"name": "AWS SDK for JavaScript Team",
Expand Down
4 changes: 2 additions & 2 deletions packages/eventstream-handler-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/middleware-api-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/middleware-bucket-endpoint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:watch": "vitest watch"
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand Down
Loading

0 comments on commit 361a738

Please sign in to comment.