@@ -33,26 +33,31 @@ test('can cache something', async () => {
3333 const fingerprint = Fingerprint . fromString (
3434 `{"random":${ Math . random ( ) } }` as FingerprintString ,
3535 ) ;
36- const result = await cache . get ( script , fingerprint ) ;
37- assert . equal ( result , undefined ) ;
3836
39- // const setResult = await cache.set(script, fingerprint, [
40- // {
41- // _AbsoluteEntryBrand_: true as never,
42- // name: import.meta.filename,
43- // path: import.meta.filename,
44- // dirent: {
45- // name: import.meta.filename,
46- // isBlockDevice: () => false,
47- // isCharacterDevice: () => false,
48- // isDirectory: () => false,
49- // isFIFO: () => false,
50- // isFile: () => true,
51- // isSocket: () => false,
52- // isSymbolicLink: () => false,
53- // },
54- // },
55- // ]);
37+ const get1 = await cache . get ( script , fingerprint ) ;
38+ assert . is ( get1 , undefined ) ;
39+
40+ const set1 = await cache . set ( script , fingerprint , [
41+ {
42+ _AbsoluteEntryBrand_ : true as never ,
43+ name : import . meta. filename ,
44+ path : import . meta. filename ,
45+ dirent : {
46+ name : import . meta. filename ,
47+ isBlockDevice : ( ) => false ,
48+ isCharacterDevice : ( ) => false ,
49+ isDirectory : ( ) => false ,
50+ isFIFO : ( ) => false ,
51+ isFile : ( ) => true ,
52+ isSocket : ( ) => false ,
53+ isSymbolicLink : ( ) => false ,
54+ } ,
55+ } ,
56+ ] ) ;
57+ assert . is ( set1 , true ) ;
58+
59+ const get2 = await cache . get ( script , fingerprint ) ;
60+ assert . ok ( get2 ) ;
5661} ) ;
5762
5863test . run ( ) ;
0 commit comments