Skip to content

Commit

Permalink
ci: fix global.AbortController test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Apr 30, 2022
1 parent e717785 commit 955935a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/fetch.js
Expand Up @@ -7,6 +7,16 @@ const clock = new Clock()
t.teardown(clock.enter())
clock.advance(1)

// if we're on a version that *doesn't* have a native AbortController,
// put the polyfill in there to start with, so LRU covers both cases.
global.AbortController = global.AbortController || Object.assign(
class AbortController {
constructor () { this.signal = new global.AbortController.AbortSignal }
abort () { this.signal.aborted = true }
},
{ AbortSignal: class AbortSignal { constructor () { this.aborted = false }}}
)

const LRU = require('../')
const c = new LRU({
fetchMethod: fn,
Expand Down

0 comments on commit 955935a

Please sign in to comment.