Bring back yarn test script (#12072)

This commit is contained in:
fisker Cheung authored and GitHub committed 2022-01-12 08:47:55 +08:00
1 parent 668bbe7d0e
commit ddd45cf511
7 files changed
+26 -32

No files matched your search

+1 -4
View File
@@ -47,7 +47,4 @@ jobs:
run: npm install --global pnpm
- name: Run Tests
run: yarn test:dev-package:integration --maxWorkers=2
- name: Run Tests
run: yarn test:dev-package:format --maxWorkers=2
run: yarn test:dev-package --maxWorkers=2
+1 -1
View File
@@ -86,7 +86,7 @@ jobs:
# #8073 test
- name: Run Tests (PRETTIER_FALLBACK_RESOLVE)
run: yarn c8 yarn test:integration "tests/integration/__tests__/(config|plugin)"
run: yarn test "tests/integration/__tests__/(config|plugin)"
env:
PRETTIER_FALLBACK_RESOLVE: true
+8 -16
View File
@@ -65,7 +65,7 @@ jobs:
path: dist
- name: Lint Code
run: yarn test:dist:lint
run: yarn test:dist-lint
test:
timeout-minutes: 90
@@ -113,33 +113,25 @@ jobs:
name: dist
path: dist
- name: Run Integration Tests (macOS)
- name: Run Tests (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: yarn test:dist:integration --maxWorkers=4
run: yarn test:dist --maxWorkers=4
- name: Run Integration Tests (Linux and Windows)
- name: Run Tests (Linux and Windows)
if: ${{ matrix.os != 'macos-latest' }}
run: yarn test:dist:integration --maxWorkers=2
- name: Run Format Tests (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: yarn test:dist:format --maxWorkers=4
- name: Run Format Tests (Linux and Windows)
if: ${{ matrix.os != 'macos-latest' }}
run: yarn test:dist:format --maxWorkers=2
run: yarn test:dist --maxWorkers=2
- name: Run Format Tests (standalone) (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: yarn test:dist:standalone:format --maxWorkers=4
run: yarn test:dist-standalone --maxWorkers=4
- name: Run Format Tests (standalone) (Linux and Windows)
if: ${{ matrix.os != 'macos-latest' }}
run: yarn test:dist:standalone:format --maxWorkers=2
run: yarn test:dist-standalone --maxWorkers=2
# #8073 test
- name: Run Tests (PRETTIER_FALLBACK_RESOLVE)
run: yarn test:dist:integration "tests/integration/__tests__/(config|plugin)"
run: yarn test "tests/integration/__tests__/(config|plugin)"
env:
NODE_ENV: production
PRETTIER_FALLBACK_RESOLVE: true
+3 -1
View File
@@ -1,9 +1,11 @@
import baseConfig from "./jest.config.mjs";
const config = {
...baseConfig,
runner: "./tests/config/jest-light-runner",
testRegex: "tests/format/.*/jsfmt\\.spec\\.js$",
...baseConfig,
setupFiles: ["<rootDir>/tests/config/setup.js"],
projects: [],
};
export default config;
+2 -1
View File
@@ -1,8 +1,9 @@
import baseConfig from "./jest.config.mjs";
const config = {
testRegex: "tests/integration/__tests__/.*\\.js$",
...baseConfig,
testRegex: "tests/integration/__tests__/.*\\.js$",
projects: [],
};
export default config;
+4 -1
View File
@@ -29,7 +29,10 @@ if (!isProduction) {
}
const config = {
setupFiles: ["<rootDir>/tests/config/setup.js"],
projects: [
"<rootDir>/jest-format-test.config.mjs",
"<rootDir>/jest-integration-test.config.mjs",
],
snapshotSerializers: [
"jest-snapshot-serializer-raw",
"jest-snapshot-serializer-ansi",
+7 -8
View File
@@ -136,14 +136,13 @@
},
"scripts": {
"prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1",
"test:integration": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=jest-integration-test.config.mjs",
"test:format": "jest --config=jest-format-test.config.mjs",
"test:dev-package:integration": "cross-env INSTALL_PACKAGE=1 yarn test:integration",
"test:dev-package:format": "cross-env INSTALL_PACKAGE=1 yarn test:format",
"test:dist:lint": "eslint --no-eslintrc --no-ignore --no-inline-config --config=./scripts/bundle-eslint-config.js \"dist/!(bin-prettier|index|third-party).js\"",
"test:dist:integration": "cross-env NODE_ENV=production yarn test:integration",
"test:dist:format": "cross-env NODE_ENV=production yarn test:format",
"test:dist:standalone:format": "cross-env TEST_STANDALONE=1 yarn test:dist:format",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"test:integration": "yarn test --config=jest-integration-test.config.mjs",
"test:format": "yarn test --config=jest-format-test.config.mjs",
"test:dev-package": "cross-env INSTALL_PACKAGE=1 yarn test",
"test:dist": "cross-env NODE_ENV=production yarn test",
"test:dist-standalone": "cross-env TEST_STANDALONE=1 yarn test:dist",
"test:dist-lint": "eslint --no-eslintrc --no-ignore --no-inline-config --config=./scripts/bundle-eslint-config.js \"dist/!(bin-prettier|index|third-party).js\"",
"perf:repeat": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js --debug-repeat ${PERF_REPEAT:-1000} --loglevel debug ${PERF_FILE:-./index.js} > /dev/null",
"perf:repeat-inspect": "yarn && yarn build && cross-env NODE_ENV=production node --inspect-brk ./dist/bin-prettier.js --debug-repeat ${PERF_REPEAT:-1000} --loglevel debug ${PERF_FILE:-./index.js} > /dev/null",
"perf:benchmark": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js --debug-benchmark --loglevel debug ${PERF_FILE:-./index.js} > /dev/null",