Skip to content

Commit 9c60e40

Browse files
committed
remove unnecessary check
AbortController is supported since Node14 and the lowest we test with is Node18
1 parent a3b15b7 commit 9c60e40

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

packages/client/lib/client/index.spec.ts

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -239,29 +239,19 @@ describe('Client', () => {
239239
assert.equal(await client.sendCommand(['PING']), 'PONG');
240240
}, GLOBAL.SERVERS.OPEN);
241241

242-
describe('AbortController', () => {
243-
before(function () {
244-
if (!global.AbortController) {
245-
this.skip();
246-
}
242+
testUtils.testWithClient('Unactivated AbortController should not abort', async client => {
243+
await client.sendCommand(['PING'], {
244+
abortSignal: new AbortController().signal
247245
});
246+
}, GLOBAL.SERVERS.OPEN);
248247

249-
testUtils.testWithClient('success', async client => {
250-
await client.sendCommand(['PING'], {
251-
abortSignal: new AbortController().signal
252-
});
253-
}, GLOBAL.SERVERS.OPEN);
254-
255-
testUtils.testWithClient('AbortError', async client => {
256-
await blockSetImmediate(async () => {
257-
await assert.rejects(client.sendCommand(['PING'], {
258-
abortSignal: AbortSignal.timeout(5)
259-
}), AbortError);
260-
})
261-
}, GLOBAL.SERVERS.OPEN);
262-
263-
});
264-
248+
testUtils.testWithClient('AbortError', async client => {
249+
await blockSetImmediate(async () => {
250+
await assert.rejects(client.sendCommand(['PING'], {
251+
abortSignal: AbortSignal.timeout(5)
252+
}), AbortError);
253+
})
254+
}, GLOBAL.SERVERS.OPEN);
265255

266256
testUtils.testWithClient('Timeout with custom timeout config', async client => {
267257
await blockSetImmediate(async () => {

0 commit comments

Comments
 (0)