PHP 8.2.30
Preview: cache.spec.ts Size: 527 B
/home/byroehnu/.trash/node_modules11/simple-update-notifier/src/cache.spec.ts

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);
});

Directory Contents

Dirs: 0 × Files: 11

Name Size Perms Modified Actions
371 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download
527 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download
1.03 KB lrw-r--r-- 2026-02-03 15:06:46
Edit Download
810 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download
811 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download
2.32 KB lrw-r--r-- 2026-02-03 15:06:46
Edit Download
1.12 KB lrw-r--r-- 2026-02-03 15:06:46
Edit Download
744 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download
984 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download
444 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download
202 B lrw-r--r-- 2026-02-03 15:06:46
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).