Skip to content

Commit f70a9dc

Browse files
committed
Fix CI failures: update Node.js matrix and test configuration
- Drop Node.js 14.x and 16.x from CI matrix (pnpm 10 requires >= 18.12, vitest 4 / vite 7 requires >= 20) - Test on Node.js 20.x and 22.x instead - Move e2e test exclusion from global vitest config to per-package test scripts so that test-e2e commands still work - Fix get-uri file descriptor GC error by passing the FileHandle directly to createReadStream instead of extracting the raw fd
1 parent 08e62f7 commit f70a9dc

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest, macos-latest, windows-latest]
18-
node-version: [14.x, 16.x, 18.x, 20.x]
19-
exclude:
20-
# Node 14 is not supported on macOS arm64
21-
- os: macos-latest
22-
node-version: 14.x
18+
node-version: [20.x, 22.x]
2319
fail-fast: false
2420

2521
runs-on: ${{ matrix.os }}

packages/get-uri/src/file.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export const file: GetUriProtocol<FileOptions> = async (
4242
// `open()` first to get a file descriptor and ensure that the file
4343
// exists.
4444
const fdHandle = await fsPromises.open(filepath, flags, mode);
45-
// extract the numeric file descriptor
46-
const fd = fdHandle.fd;
4745

4846
// store the stat object for the cache.
4947
const stat = await fdHandle.stat();
@@ -54,12 +52,12 @@ export const file: GetUriProtocol<FileOptions> = async (
5452
throw new NotModifiedError();
5553
}
5654

57-
// `fs.ReadStream` takes care of calling `fs.close()` on the
58-
// fd after it's done reading
55+
// `fs.ReadStream` takes care of closing the file handle
56+
// after it's done reading
5957
const rs = createReadStream(filepath, {
6058
autoClose: true,
6159
...opts,
62-
fd,
60+
fd: fdHandle,
6361
}) as FileReadable;
6462
rs.stat = stat;
6563
return rs;

packages/https-proxy-agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
],
1515
"scripts": {
1616
"build": "tsc",
17-
"test": "vitest",
17+
"test": "vitest --exclude test/e2e.test.ts",
1818
"test-e2e": "vitest run test/e2e.test.ts",
1919
"lint": "eslint --ext .ts",
2020
"pack": "node ../../scripts/pack.mjs"

packages/socks-proxy-agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
},
136136
"scripts": {
137137
"build": "tsc",
138-
"test": "vitest",
138+
"test": "vitest --exclude test/e2e.test.ts",
139139
"test-e2e": "vitest run test/e2e.test.ts",
140140
"lint": "eslint . --ext .ts",
141141
"pack": "node ../../scripts/pack.mjs"

vitest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ export default defineConfig({
55
globals: true,
66
testTimeout: 10000,
77
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)', '**/test/test.[jt]s?(x)'],
8-
exclude: ['**/node_modules/**', '**/.git/**', '**/e2e.test.*'],
98
},
109
});

0 commit comments

Comments
 (0)