Skip to content

Commit c1943e4

Browse files
committed
f
1 parent 02a3ef5 commit c1943e4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

test/HttpClient.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('HttpClient.test.ts', () => {
110110
httpClient.request(_url),
111111
]);
112112
console.log(httpClient.getDispatcherPoolStats());
113-
assert.equal(httpClient.getDispatcherPoolStats()['https://registry.npmmirror.com'].connected, 1);
113+
assert.equal(httpClient.getDispatcherPoolStats()['https://registry.npmmirror.com'].connected, 4);
114114
assert(httpClient.getDispatcherPoolStats()[_url.substring(0, _url.length - 1)].connected > 1);
115115
});
116116
});

test/options.writeStream.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,13 @@ describe('options.writeStream.test.ts', () => {
117117
// only Node.js >= 18 has stream.emitError
118118
if (err.message !== 'writeStream is destroyed') {
119119
assert.equal(err.name, 'Error');
120-
assert.equal(err.code, 'ENOENT');
121-
assert.match(err.message, /no such file or directory/);
120+
assert.match(err.code, /^ENOENT|ERR_STREAM_UNABLE_TO_PIPE$/);
121+
if (err.code === 'ERR_STREAM_UNABLE_TO_PIPE') {
122+
// change to ERR_STREAM_UNABLE_TO_PIPE on Node.js >= 23
123+
assert.equal(err.message, 'Cannot pipe to a closed or destroyed stream');
124+
} else {
125+
assert.match(err.message, /no such file or directory/);
126+
}
122127
}
123128
return true;
124129
});

0 commit comments

Comments
 (0)