finki-main
main
|
Last change
on this file since 62b2964 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
527 bytes
|
| Line | |
|---|
| 1 | import { createConfigDir, getLastUpdate, saveLastUpdate } from './cache';
|
|---|
| 2 |
|
|---|
| 3 | createConfigDir();
|
|---|
| 4 |
|
|---|
| 5 | jest.useFakeTimers().setSystemTime(new Date('2022-01-01'));
|
|---|
| 6 |
|
|---|
| 7 | const fakeTime = new Date('2022-01-01').getTime();
|
|---|
| 8 |
|
|---|
| 9 | test('can save update then get the update details', () => {
|
|---|
| 10 | saveLastUpdate('test');
|
|---|
| 11 | expect(getLastUpdate('test')).toBe(fakeTime);
|
|---|
| 12 | });
|
|---|
| 13 |
|
|---|
| 14 | test('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.