diff --git a/test/fetch/request.js b/test/fetch/request.js index 1f4061b2ebe..af6a36f2d24 100644 --- a/test/fetch/request.js +++ b/test/fetch/request.js @@ -262,8 +262,8 @@ test('pre aborted signal', () => { assert.strictEqual(req.signal.reason, 'gwak') }) -test('post aborted signal', (t) => { - const { strictEqual } = tspl(t, { plan: 2 }) +test('post aborted signal', async (t) => { + const { strictEqual, completed } = tspl(t, { plan: 2 }) const ac = new AbortController() const req = new Request('http://asd', { signal: ac.signal }) @@ -272,6 +272,8 @@ test('post aborted signal', (t) => { strictEqual(req.signal.reason, 'gwak') }, { once: true }) ac.abort('gwak') + + await completed }) test('pre aborted signal cloned', () => { @@ -303,8 +305,8 @@ test('URLSearchParams body with Headers object - issue #1407', async () => { assert.strictEqual(await request.text(), 'abc=123') }) -test('post aborted signal cloned', (t) => { - const { strictEqual } = tspl(t, { plan: 2 }) +test('post aborted signal cloned', async (t) => { + const { strictEqual, completed } = tspl(t, { plan: 2 }) const ac = new AbortController() const req = new Request('http://asd', { signal: ac.signal }).clone() @@ -313,6 +315,8 @@ test('post aborted signal cloned', (t) => { strictEqual(req.signal.reason, 'gwak') }, { once: true }) ac.abort('gwak') + + await completed }) test('Passing headers in init', async (t) => {