Skip to content

Commit

Permalink
[Test][core] inline build:test commands into browser test scripts
Browse files Browse the repository at this point in the history
As far as I know for the majority of our packages we don't need to run
`build:test` as we either runs test on .ts files, or `build` script already
generates the .js files under `dist-esm`. Currently we only need to build the
test for browser testing.

This PR moves commands in `build:test` into the browser test scripts, thus
saving us from rebuilding when testing for NodeJS.
  • Loading branch information
jeremymeng committed Apr 23, 2024
1 parent b46e005 commit efb1f38
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions sdk/core/abort-controller/package.json
Expand Up @@ -57,7 +57,7 @@
],
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,mjs,cjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -73,7 +73,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-auth/package.json
Expand Up @@ -51,7 +51,7 @@
"sideEffects": false,
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-client-rest/package.json
Expand Up @@ -51,7 +51,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-client/package.json
Expand Up @@ -51,7 +51,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-http-compat/package.json
Expand Up @@ -51,7 +51,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,mts}\" \"test/**/*.{ts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "echo skipped",
"test:node": "echo skipped",
"test": "npm run clean && npm run build && npm run unit-test:node && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-lro/package.json
Expand Up @@ -66,7 +66,7 @@
"sideEffects": false,
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* types *.log browser statistics.html coverage src/**/*.js test/**/*.js",
Expand All @@ -82,7 +82,7 @@
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-paging/package.json
Expand Up @@ -57,7 +57,7 @@
"private": false,
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp *.tgz types *.log",
Expand All @@ -73,7 +73,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-rest-pipeline/package.json
Expand Up @@ -51,7 +51,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-sse/package.json
Expand Up @@ -55,7 +55,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -71,7 +71,7 @@
"test:browser": "npm run clean && npm run build && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-tracing/package.json
Expand Up @@ -51,7 +51,7 @@
"sideEffects": false,
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-util/package.json
Expand Up @@ -51,7 +51,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-xml/package.json
Expand Up @@ -51,7 +51,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/logger/package.json
Expand Up @@ -57,7 +57,7 @@
"sideEffects": false,
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp *.tgz *.log",
Expand All @@ -74,7 +74,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/ts-http-runtime/package.json
Expand Up @@ -51,7 +51,7 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
Expand All @@ -67,7 +67,7 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
Expand Down

0 comments on commit efb1f38

Please sign in to comment.