Skip to content

Commit 17a482c

Browse files
committed
CI: Fix cookbook test script
When I removed the cookbook-loader.mjs, I accidentally broke the test-cookbook-one script in package.json. It made the tests always pass because the actual test was no longer loaded due to the presence of the --eval command line argument. Instead, use --require to define a global assert property.
1 parent ed49b0b commit 17a482c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/cookbook/assert.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
globalThis.assert = require('node:assert').strict;

polyfill/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"test": "node ./test/all.mjs",
1111
"test-cookbook": "npm run build && TEST=all npm run test-cookbook-one",
12-
"test-cookbook-one": "node --require=./script.js --eval='globalThis.assert = require(`node:assert`).strict' ../docs/cookbook/$TEST.mjs",
12+
"test-cookbook-one": "node --require=./script.js --require=../docs/cookbook/assert.js ../docs/cookbook/$TEST.mjs",
1313
"test262": "npm run build262 && node runtest262.mjs",
1414
"codecov:test262": "./ci_codecov_test262.sh",
1515
"build": "rollup -c rollup.config.js --bundleConfigAsCjs",

0 commit comments

Comments
 (0)