forked from olcxjas-softworks/LarpixClient
Update gitignore (sorry)
This commit is contained in:
parent
a8f8c4d7ad
commit
cca8b02fea
6604 changed files with 1219661 additions and 4 deletions
27
electron/node_modules/simple-update-notifier/src/index.spec.ts
generated
vendored
Normal file
27
electron/node_modules/simple-update-notifier/src/index.spec.ts
generated
vendored
Normal 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);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue