@@ -3,9 +3,6 @@ import {Agent, request} from 'node:http';
33import url from 'node:url' ;
44import util , { promisify as pm } from 'node:util' ;
55import { gzip , gunzip } from 'node:zlib' ;
6- import path from 'node:path' ;
7- import { mock } from 'node:test' ;
8- import { hostname } from 'node:os' ;
96import {
107 test , beforeAll , afterAll , expect ,
118} from 'vitest' ;
@@ -15,6 +12,8 @@ import {Keyv} from 'keyv';
1512import CacheableRequest , { CacheValue , onResponse } from '../src/index.js' ;
1613import createTestServer from './create-test-server/index.mjs' ;
1714
15+ const testTimeout = 10_000 ;
16+
1817// Promisify cacheableRequest
1918const 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
267266test ( 'strips default path' , async ( ) => {
268267 const expected = 'GET:http://mockhttp.org' ;
0 commit comments