Skip to content

Commit 5ec40ab

Browse files
authored
cacheable-request - feat: adding testTimeout to some unit tests (#1244)
1 parent 59b35d6 commit 5ec40ab

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/cacheable-request/test/cache.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import {Agent, request} from 'node:http';
33
import url from 'node:url';
44
import util, {promisify as pm} from 'node:util';
55
import {gzip, gunzip} from 'node:zlib';
6-
import path from 'node:path';
7-
import {mock} from 'node:test';
8-
import {hostname} from 'node:os';
96
import {
107
test, beforeAll, afterAll, expect,
118
} from 'vitest';
@@ -15,6 +12,8 @@ import {Keyv} from 'keyv';
1512
import CacheableRequest, {CacheValue, onResponse} from '../src/index.js';
1613
import createTestServer from './create-test-server/index.mjs';
1714

15+
const testTimeout = 10_000;
16+
1817
// Promisify cacheableRequest
1918
const promisify = (cacheableRequest: any) => async (options: any) => new Promise((resolve, reject) => {
2019
cacheableRequest(options, async (response: any) => {
@@ -262,7 +261,7 @@ test('return with GET', async () => {
262261
const expectKey = `cacheable-request:${expected}`;
263262
const actualKey = await testCacheKeyReturn('http://mockhttp.org');
264263
expect(actualKey).toBe(expectKey);
265-
});
264+
}, testTimeout);
266265

267266
test('strips default path', async () => {
268267
const expected = 'GET:http://mockhttp.org';

0 commit comments

Comments
 (0)