Skip to content

Commit cd8f37b

Browse files
committed
test: loosen test on onInsert
1 parent c440996 commit cd8f37b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/onInsert.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ t.test('no onInsert for background fetch promises', async t => {
8181
max: 5,
8282
onInsert: (v, k, r) => inserted.push([v, k, r]),
8383
fetchMethod: async x => x,
84-
ttl: 1,
84+
ttl: 10,
8585
})
8686
c.set('y', 'Y')
87+
t.strictSame(inserted, [['Y', 'y' ,'add']])
8788
c.set('z', 'Z')
89+
t.strictSame(inserted, [['Y', 'y' ,'add'], ['Z', 'z', 'add']])
8890
const x = await c.fetch('x')
8991
const y = await c.fetch('y')
9092
await new Promise(res => setTimeout(res, 50))

0 commit comments

Comments
 (0)