Skip to content

Commit 91248dc

Browse files
committed
Use http loader for perf tests
1 parent 075af12 commit 91248dc

3 files changed

Lines changed: 10 additions & 28 deletions

File tree

package-lock.json

Lines changed: 7 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"scripts": {
3131
"build": "esbuild subscript.js --bundle --minify --format=esm --outfile=subscript.min.js && esbuild justin.js --bundle --minify --format=esm --outfile=justin.min.js && esbuild jessie.js --bundle --minify --format=esm --outfile=jessie.min.js",
3232
"prepublishOnly": "npm run build",
33-
"test": "node test/test.js",
33+
"test": "node --import ./test/https-loader.js test/test.js",
3434
"check-types": "tsc --noEmit subscript.d.ts"
3535
},
3636
"repository": {
@@ -77,6 +77,6 @@
7777
"@playwright/test": "^1.57.0",
7878
"esbuild": "^0.27.2",
7979
"terser": "^5.44.1",
80-
"tst": "^9.2.0"
80+
"tst": "^9.2.1"
8181
}
8282
}

test/perf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ const RUNS = 3e4
44
const src = c => `1 + (a * b / c % d) - 2.0 + -3e-3 * +4.4e4 / f.g[0] - i.j(+k == 1)(${c})`
55
const subscriptUrl = new URL('../subscript.js', import.meta.url).href
66
const justinUrl = new URL('../justin.js', import.meta.url).href
7-
// Always use CDN - Node requires --import ./test/https-loader.js
8-
const jsepUrl = 'https://esm.sh/jsep'
7+
const jsepUrl = 'https://cdn.jsdelivr.net/npm/jsep@1.4.0/dist/jsep.js'
98

109
test.fork('perf: expr < jsep', {data: {RUNS, src, subscriptUrl, jsepUrl}}, async ({ ok }, {RUNS, src, subscriptUrl, jsepUrl}) => {
1110
const bench = (fn) => {

0 commit comments

Comments
 (0)