2016-11-22 16:13:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
require('../common');
|
|
|
|
const commonPath = require.resolve('../common');
|
|
|
|
const initHooks = require('./init-hooks');
|
|
|
|
const verifyGraph = require('./verify-graph');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const hooks = initHooks();
|
|
|
|
hooks.enable();
|
|
|
|
|
|
|
|
function onchange() { }
|
2019-03-22 02:44:26 +00:00
|
|
|
// Install first file watcher
|
2016-11-22 16:13:44 +00:00
|
|
|
fs.watchFile(__filename, onchange);
|
|
|
|
|
2019-03-22 02:44:26 +00:00
|
|
|
// Install second file watcher
|
2016-11-22 16:13:44 +00:00
|
|
|
fs.watchFile(commonPath, onchange);
|
|
|
|
|
2019-03-22 02:44:26 +00:00
|
|
|
// Remove first file watcher
|
2016-11-22 16:13:44 +00:00
|
|
|
fs.unwatchFile(__filename);
|
|
|
|
|
2019-03-22 02:44:26 +00:00
|
|
|
// Remove second file watcher
|
2016-11-22 16:13:44 +00:00
|
|
|
fs.unwatchFile(commonPath);
|
|
|
|
|
|
|
|
process.on('exit', onexit);
|
|
|
|
|
|
|
|
function onexit() {
|
|
|
|
hooks.disable();
|
|
|
|
verifyGraph(
|
|
|
|
hooks,
|
2017-06-14 10:39:53 +00:00
|
|
|
[ { type: 'STATWATCHER', id: 'statwatcher:1', triggerAsyncId: null },
|
2022-11-21 17:43:47 +00:00
|
|
|
{ type: 'STATWATCHER', id: 'statwatcher:2', triggerAsyncId: null } ],
|
2016-11-22 16:13:44 +00:00
|
|
|
);
|
|
|
|
}
|