Skip to content

Commit

Permalink
test: 延长时间间隔
Browse files Browse the repository at this point in the history
  • Loading branch information
geekact committed Jul 21, 2024
1 parent 44658ce commit 4a1fc3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test('相同请求可以命中缓存', async () => {

test('过期时间', async () => {
const cache = new CacheSlot({
maxAge: 200,
maxAge: 2000,
});
const config: InternalAxiosRequestConfig = {
method: 'get',
Expand All @@ -44,9 +44,9 @@ test('过期时间', async () => {

const a = await cache.hit(config, resolveResponse);
const b = await cache.hit(config, resolveResponse);
await sleep(150);
await sleep(1000);
const c = await cache.hit(config, resolveResponse);
await sleep(51);
await sleep(1800);
const d = await cache.hit(config, resolveResponse);

expect(a.data).toEqual(b.data);
Expand Down

0 comments on commit 4a1fc3d

Please sign in to comment.