Skip to content

Commit

Permalink
refactor: remove delay dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Sep 5, 2023
1 parent 3d8963d commit c8ef31b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -40,7 +40,6 @@
"c8": "latest",
"ci-publish": "latest",
"conventional-github-releaser": "latest",
"delay": "latest",
"finepack": "latest",
"git-authors-cli": "latest",
"nano-staged": "latest",
Expand Down
4 changes: 2 additions & 2 deletions test/get.js
@@ -1,6 +1,6 @@
'use strict'

const delay = require('delay')
const { setTimeout } = require('timers/promises')
const test = require('ava')

const { keyvB2, keyvS3 } = require('./util')
Expand Down Expand Up @@ -31,7 +31,7 @@ const { keyvB2, keyvS3 } = require('./util')
test(`${provider} » if key expires, returns undefined`, async t => {
const ttl = 100
await keyv.set('foo3', 'bar3', ttl)
await delay(ttl)
await setTimeout(ttl)
t.is(await keyv.get('foo3'), undefined)
})
})
4 changes: 2 additions & 2 deletions test/set.js
@@ -1,6 +1,6 @@
'use strict'

const delay = require('delay')
const { setTimeout } = require('timers/promises')
const test = require('ava')
const got = require('got')

Expand All @@ -26,7 +26,7 @@ const { keyvB2, keyvS3 } = require('./util')

t.is(!!headers.expires, true)

await delay(ttl)
await setTimeout(ttl)

t.is(await keyv.get(key), undefined)
})
Expand Down

0 comments on commit c8ef31b

Please sign in to comment.