diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index dc5a6a16a63..dc3fbb33304 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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 test-fuzzing: name: Fuzzing diff --git a/package.json b/package.json index 1dd93607bb1..7dd4ae8b9c8 100644 --- a/package.json +++ b/package.json @@ -65,19 +65,18 @@ "build:node": "npx esbuild@0.19.10 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: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\"", diff --git a/scripts/strip-comments.js b/scripts/strip-comments.js index 9e4396a5dea..d687a268090 100644 --- a/scripts/strip-comments.js +++ b/scripts/strip-comments.js @@ -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'))