CoolFace
Apppublic

opusdev/vector-similarity-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
cache.spec.ts18 linesDownload Raw Back to src
1import { createConfigDir, getLastUpdate, saveLastUpdate } from './cache';2 3createConfigDir();4 5jest.useFakeTimers().setSystemTime(new Date('2022-01-01'));6 7const fakeTime = new Date('2022-01-01').getTime();8 9test('can save update then get the update details', () => {10  saveLastUpdate('test');11  expect(getLastUpdate('test')).toBe(fakeTime);12});13 14test('prefixed module can save update then get the update details', () => {15  saveLastUpdate('@alexbrazier/test');16  expect(getLastUpdate('@alexbrazier/test')).toBe(fakeTime);17});18