git ssb

0+

cel-desktop / ssb-pkg



Tree: 65191f9a9664f013ebe726bb95a1a54b086e1bd5

Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-79-npm / update-notifier / update-notifier.js

753 bytesRaw
1'use strict';
2
3// anyway testing in ci
4require('ci-info').isCI = false;
5
6var spawnWasCalled;
7var save = require('child_process').spawn;
8require('child_process').spawn = function () {
9 spawnWasCalled = true;
10 return save.apply(this, arguments); // eslint-disable-line prefer-rest-params
11};
12
13var updateNotifier = require('update-notifier');
14var pjson = { name: 'pkg', version: '3.0.0' };
15var notifier;
16
17function runNotifier () {
18 notifier = updateNotifier({
19 pkg: pjson,
20 updateCheckInterval: 0
21 });
22 setTimeout(function () {
23 if (spawnWasCalled &&
24 notifier.update &&
25 notifier.update.current === '3.0.0') {
26 console.log('ok');
27 process.exit(0);
28 } else {
29 runNotifier();
30 }
31 }, 1984);
32}
33
34runNotifier();
35

Built with git-ssb-web