-
Notifications
You must be signed in to change notification settings - Fork 332
/
test.updates.js
29 lines (26 loc) · 958 Bytes
/
test.updates.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* @flow */
import {it, describe} from 'mocha';
import {assert} from 'chai';
import sinon from 'sinon';
import {checkForUpdates} from '../../../src/util/updates';
describe('util/updates', () => {
describe('checkForUpdates()', () => {
it('calls the notifier with the correct parameters', () => {
const updateNotifierStub = sinon.spy(() => {
return {
notify: sinon.spy(),
};
});
checkForUpdates({
version: '1.0.0',
updateNotifier: updateNotifierStub,
});
assert.equal(updateNotifierStub.called, true);
assert.equal(updateNotifierStub.firstCall.args[0].pkg.name, 'web-ext');
assert.equal(updateNotifierStub.firstCall.args[0].pkg.version, '1.0.0');
assert.isNumber(updateNotifierStub.firstCall.args[0].updateCheckInterval);
assert.equal(updateNotifierStub.firstCall.args[0].updateCheckInterval,
1000 * 60 * 60 * 24 * 3);
});
});
});