source: node_modules/simple-update-notifier/src/cache.spec.ts

main
Last change on this file was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 527 bytes
RevLine 
[81bc7da]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});
Note: See TracBrowser for help on using the repository browser.