Skip to content

Commit cd27f30

Browse files
committed
Build: Run pretest before test:* npm scripts
Build was already happening in scripts like `test:browser` but those scripts were missing `pretest`, meaning that running `npm install && npm test:browser` may have failed if `pretest` wasn't run before or if its results were out of date. Even worse, with such stale data some tests may erroneously succeed. This also removes a separate `pretest` step from GitHub Actions as it's no longer needed. Closes gh-5338 (cherry picked from commit 1ad66ae)
1 parent ce52a5d commit cd27f30

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

.github/workflows/node.js.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ jobs:
7575
run: npm run build && npm run lint
7676
if: matrix.NODE_VERSION == '18.x'
7777

78-
- name: Prepare tests
79-
run: npm run pretest
80-
8178
- name: Run tests
8279
env:
8380
BROWSERS: ${{ matrix.BROWSERS }}

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"pretest": "npm run qunit-fixture && npm run babel:tests && npm run npmcopy",
1919
"qunit-fixture": "node build/tasks/qunit-fixture.js",
2020
"start": "nodemon --watch src -x \"npm run build:all\"",
21-
"test:browserless": "npm run test:node_smoke_tests && npm run test:promises_aplus && npm run test:jsdom",
22-
"test:browser": "npm run build:all && grunt karma:main",
23-
"test:amd": "npm run build:main && grunt karma:amd",
24-
"test:jsdom": "npm run build:main && grunt test:jsdom",
25-
"test:no-deprecated": "npm run build -- -e deprecated && grunt karma:main",
26-
"test:selector-native": "npm run build -- -e selector && grunt karma:main",
27-
"test:slim": "npm run build -- --slim && grunt karma:main",
28-
"test:node_smoke_tests": "npm run build:all && node build/tasks/node_smoke_tests.js",
21+
"test:browserless": "npm run pretest && npm run test:node_smoke_tests && npm run test:promises_aplus && npm run test:jsdom",
22+
"test:browser": "npm run pretest && npm run build:all && grunt karma:main",
23+
"test:amd": "npm run pretest && npm run build:main && grunt karma:amd",
24+
"test:jsdom": "npm run pretest && npm run build:main && grunt test:jsdom",
25+
"test:no-deprecated": "npm run pretest && npm run build -- -e deprecated && grunt karma:main",
26+
"test:selector-native": "npm run pretest && npm run build -- -e selector && grunt karma:main",
27+
"test:slim": "npm run pretest && npm run build -- --slim && grunt karma:main",
28+
"test:node_smoke_tests": "npm run pretest && npm run build:all && node build/tasks/node_smoke_tests.js",
2929
"test:promises_aplus": "npm run build:main && node build/tasks/promises_aplus_tests.js",
3030
"test": "npm run build:all && npm run lint && npm run test:browserless && npm run test:browser && npm run test:amd && npm run test:slim && npm run test:no-deprecated && npm run test:selector-native"
3131
},

0 commit comments

Comments
 (0)