From ea8bb50be8db29cd0a4bbdad59036612b60c081f Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 5 Dec 2023 15:46:52 +0800 Subject: [PATCH 1/3] test: use vitest v1 --- package.json | 4 ++-- scripts/pre_test.js | 4 ++-- test/options.timeout.test.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 14d96e01..b84eb52f 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@types/qs": "^6.9.7", "@types/selfsigned": "^2.0.1", "@types/tar-stream": "^2.2.2", - "@vitest/coverage-v8": "beta", + "@vitest/coverage-v8": "^1.0.1", "busboy": "^1.6.0", "cross-env": "^7.0.3", "eslint": "^8.25.0", @@ -82,7 +82,7 @@ "tshy": "^1.0.0", "tshy-after": "^1.0.0", "typescript": "^5.0.4", - "vitest": "beta" + "vitest": "^1.0.1" }, "engines": { "node": ">= 14.19.3" diff --git a/scripts/pre_test.js b/scripts/pre_test.js index 239ffd40..824aa76c 100644 --- a/scripts/pre_test.js +++ b/scripts/pre_test.js @@ -4,9 +4,9 @@ function main() { if (!process.version.startsWith('v14.')) { return; } - console.log(`use vitest@^0.32.0 on Node.js ${process.version}`); + console.log(`use vitest@^0.34.0 on Node.js ${process.version}`); const cwd = process.cwd() - execSync('npm i vitest@^0.32.0 @vitest/coverage-v8@^0.32.0', { + execSync('npm i vitest@^0.34.0 @vitest/coverage-v8@^0.34.0', { cwd, stdio: [ 'inherit', 'inherit', 'inherit' ], }); diff --git a/test/options.timeout.test.ts b/test/options.timeout.test.ts index 64bf5a59..d5e9d521 100644 --- a/test/options.timeout.test.ts +++ b/test/options.timeout.test.ts @@ -61,7 +61,7 @@ describe('options.timeout.test.ts', () => { it('should timeout 500ms throw error', async () => { await assert.rejects(async () => { const response = await urllib.request(`${_url}mock-bytes?timeout=1000`, { - timeout: [ 100, 500 ], + timeout: [ 400, 500 ], }); console.log(response.status, response.headers, response.data); }, (err: any) => { From 8f7477f48cb4410fdc0e4c3eac76ec25ff4a9100 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 5 Dec 2023 15:49:22 +0800 Subject: [PATCH 2/3] f --- scripts/pre_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pre_test.js b/scripts/pre_test.js index 824aa76c..c7f16255 100644 --- a/scripts/pre_test.js +++ b/scripts/pre_test.js @@ -4,9 +4,9 @@ function main() { if (!process.version.startsWith('v14.')) { return; } - console.log(`use vitest@^0.34.0 on Node.js ${process.version}`); + console.log(`use vitest@^0.33.0 on Node.js ${process.version}`); const cwd = process.cwd() - execSync('npm i vitest@^0.34.0 @vitest/coverage-v8@^0.34.0', { + execSync('npm i vitest@^0.33.0 @vitest/coverage-v8@^0.33.0', { cwd, stdio: [ 'inherit', 'inherit', 'inherit' ], }); From 88d8eff4ca2ce43415a267e7db87c51d1e368d02 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 5 Dec 2023 15:54:31 +0800 Subject: [PATCH 3/3] f --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 80eae696..9c3eed48 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -13,5 +13,5 @@ jobs: uses: node-modules/github-actions/.github/workflows/node-test.yml@master with: os: 'ubuntu-latest, macos-latest, windows-latest' - version: '14.19.3, 14, 16, 18, 20' + version: '14.19.3, 16, 18, 20' install: 'npx npminstall'