Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikicho committed Mar 8, 2024
1 parent d0aa034 commit 3db1434
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_fetch.js
Expand Up @@ -111,6 +111,19 @@ describe('Native Fetch', () => {
scope.done()
})

it('should throw when signal is already aborted', async () => {
nock('http://example.test').get('/').reply(200)

const signal = AbortSignal.abort('reason')
try {
await fetch('http://example.test', { signal })
expect.fail()
} catch (e) {
expect(signal.aborted).to.true()
expect(e).to.equal('reason')
}
})

describe('content-encoding', () => {
it('should accept gzipped content', async () => {
const message = 'Lorem ipsum dolor sit amet'
Expand Down

0 comments on commit 3db1434

Please sign in to comment.