@@ -4,7 +4,6 @@ import { describe, test, expect } from 'manten';
44import { createFixture } from 'fs-fixture' ;
55import { spyOn } from 'tinyspy' ;
66import { FileCache } from '../../src/utils/transform/cache.js' ;
7- import { disposableSpy } from '../utils/disposable-spy.js' ;
87
98type CacheValue = {
109 value : string ;
@@ -20,7 +19,7 @@ export const transformCacheSpec = () => describe('transform cache', async () =>
2019 fixture . getPath ( 'cache' ) ,
2120 fixture . getPath ( 'old-cache' ) ,
2221 ) ;
23- using readDirectory = disposableSpy ( spyOn ( fs , 'readdirSync' ) ) ;
22+ using readDirectory = spyOn ( fs , 'readdirSync' ) ;
2423
2524 expect ( cache . get ( getKey ( 0 ) ) ) . toBeUndefined ( ) ;
2625 expect ( readDirectory . callCount ) . toBe ( 0 ) ;
@@ -124,7 +123,7 @@ export const transformCacheSpec = () => describe('transform cache', async () =>
124123 [ `cache/${ time + 1 } -${ getKey ( 3 ) } ` ] : JSON . stringify ( { value : 'next' } ) ,
125124 } ) ;
126125 const cache = new FileCache < CacheValue > ( fixture . getPath ( 'cache' ) , fixture . getPath ( 'old-cache' ) ) ;
127- using dateNow = disposableSpy ( spyOn ( Date , 'now' ) ) ;
126+ using dateNow = spyOn ( Date , 'now' ) ;
128127 dateNow . willCall ( ( ) => time * 1e8 ) ;
129128 expect ( cache . get ( getKey ( 2 ) ) ) . toStrictEqual ( { value : 'boundary' } ) ;
130129 expect ( cache . get ( getKey ( 3 ) ) ) . toBeUndefined ( ) ;
@@ -203,7 +202,7 @@ export const transformCacheSpec = () => describe('transform cache', async () =>
203202 expect ( reader . get ( getKey ( 1 ) ) ) . toBeUndefined ( ) ;
204203 expect ( reader . get ( getKey ( 2 ) ) ) . toBeUndefined ( ) ;
205204
206- using writeFileSpy = disposableSpy ( spyOn ( fs . promises , 'writeFile' ) ) ;
205+ using writeFileSpy = spyOn ( fs . promises , 'writeFile' ) ;
207206
208207 firstCache . set ( getKey ( 1 ) , { value : 'first' } ) ;
209208 firstCache . set ( getKey ( 1 ) , { value : 'first' } ) ;
0 commit comments