create daemon

This commit is contained in:
Your Name
2025-09-29 07:21:46 -04:00
parent 955090b079
commit 69514943a9
1341 changed files with 181418 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import simpleUpdateNotifier from '.';
import hasNewVersion from './hasNewVersion';
const consoleSpy = jest.spyOn(console, 'error');
jest.mock('./hasNewVersion', () => jest.fn().mockResolvedValue('2.0.0'));
beforeEach(jest.clearAllMocks);
test('it logs message if update is available', async () => {
await simpleUpdateNotifier({
pkg: { name: 'test', version: '1.0.0' },
alwaysRun: true,
});
expect(consoleSpy).toHaveBeenCalledTimes(1);
});
test('it does not log message if update is not available', async () => {
(hasNewVersion as jest.Mock).mockResolvedValue(false);
await simpleUpdateNotifier({
pkg: { name: 'test', version: '2.0.0' },
alwaysRun: true,
});
expect(consoleSpy).toHaveBeenCalledTimes(0);
});