/
Dante
/
node-core
Обзор
Документация
Войти
/
Dante
/
node-core
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/simple-update-notifier/src/cache.spec.ts
17 строк
527 B
Александр Данилюк
add
24 сен 2024, 12:59
24 сен 2024, 12:59
9eaeea8
Код
Авторство
О чём код?
import { createConfigDir, getLastUpdate, saveLastUpdate } from './cache'; createConfigDir(); jest.useFakeTimers().setSystemTime(new Date('2022-01-01')); const fakeTime = new Date('2022-01-01').getTime(); test('can save update then get the update details', () => { saveLastUpdate('test'); expect(getLastUpdate('test')).toBe(fakeTime); }); test('prefixed module can save update then get the update details', () => { saveLastUpdate('@alexbrazier/test'); expect(getLastUpdate('@alexbrazier/test')).toBe(fakeTime); });