Skip to content

Commit

Permalink
test: streamline test scripts in regard of without-intl and run more …
Browse files Browse the repository at this point in the history
…tests for without-intl case (#3453)

* test: streamline tests in regard of without-intl

* fix wf
  • Loading branch information
Uzlopak authored Aug 14, 2024
1 parent 86936d9 commit 5b7f372
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
echo icu config: $(node -e "console.log(process.config)" | grep icu)
- name: Run tests
run: npm run test:javascript:withoutintl
run: npm run test:javascript:without-intl

test-fuzzing:
name: Fuzzing
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@
"build:node": "npx [email protected] index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names && node scripts/strip-comments.js",
"prebuild:wasm": "node build/wasm.js --prebuild",
"build:wasm": "node build/wasm.js --docker",
"generate-pem": "node scripts/generate-pem.js",
"lint": "standard | snazzy",
"lint:fix": "standard --fix | snazzy",
"test": "npm run test:javascript && cross-env NODE_V8_COVERAGE= npm run test:typescript",
"test:javascript": "node scripts/generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test && npm run test:jest",
"test:javascript:withoutintl": "node scripts/generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:fetch:nobuild && npm run test:cache && npm run test:interceptors && npm run test:cookies && npm run test:eventsource:nobuild && npm run test:wpt:withoutintl && npm run test:node-test",
"test:javascript": "npm run test:javascript:no-jest && npm run test:jest",
"test:javascript:no-jest": "npm run generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test",
"test:javascript:without-intl": "npm run test:javascript:no-jest",
"test:busboy": "borp -p \"test/busboy/*.js\"",
"test:cache": "borp -p \"test/cache/*.js\"",
"test:cookies": "borp -p \"test/cookie/*.js\"",
"test:eventsource": "npm run build:node && npm run test:eventsource:nobuild",
"test:eventsource:nobuild": "borp --expose-gc -p \"test/eventsource/*.js\"",
"test:eventsource": "npm run build:node && borp --expose-gc -p \"test/eventsource/*.js\"",
"test:fuzzing": "node test/fuzzing/fuzzing.test.js",
"test:fetch": "npm run build:node && npm run test:fetch:nobuild",
"test:fetch:nobuild": "borp --timeout 180000 --expose-gc --concurrency 1 -p \"test/fetch/*.js\" && npm run test:webidl && npm run test:busboy",
"test:fetch": "npm run build:node && borp --timeout 180000 --expose-gc --concurrency 1 -p \"test/fetch/*.js\" && npm run test:webidl && npm run test:busboy",
"test:interceptors": "borp -p \"test/interceptors/*.js\"",
"test:jest": "cross-env NODE_V8_COVERAGE= jest",
"test:unit": "borp --expose-gc -p \"test/*.js\"",
Expand Down
4 changes: 3 additions & 1 deletion scripts/strip-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const { readFileSync, writeFileSync } = require('node:fs')
const { transcode } = require('node:buffer')

const buffer = transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1')
const buffer = transcode
? transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1')
: readFileSync('./undici-fetch.js')

writeFileSync('./undici-fetch.js', buffer.toString('latin1'))

0 comments on commit 5b7f372

Please sign in to comment.