11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_cirequire('../common');
41cb0ef41Sopenharmony_ciconst commonPath = require.resolve('../common');
51cb0ef41Sopenharmony_ciconst initHooks = require('./init-hooks');
61cb0ef41Sopenharmony_ciconst verifyGraph = require('./verify-graph');
71cb0ef41Sopenharmony_ciconst fs = require('fs');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst hooks = initHooks();
101cb0ef41Sopenharmony_cihooks.enable();
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_cifunction onchange() { }
131cb0ef41Sopenharmony_ci// Install first file watcher
141cb0ef41Sopenharmony_cifs.watchFile(__filename, onchange);
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_ci// Install second file watcher
171cb0ef41Sopenharmony_cifs.watchFile(commonPath, onchange);
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ci// Remove first file watcher
201cb0ef41Sopenharmony_cifs.unwatchFile(__filename);
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ci// Remove second file watcher
231cb0ef41Sopenharmony_cifs.unwatchFile(commonPath);
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ciprocess.on('exit', onexit);
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_cifunction onexit() {
281cb0ef41Sopenharmony_ci  hooks.disable();
291cb0ef41Sopenharmony_ci  verifyGraph(
301cb0ef41Sopenharmony_ci    hooks,
311cb0ef41Sopenharmony_ci    [ { type: 'STATWATCHER', id: 'statwatcher:1', triggerAsyncId: null },
321cb0ef41Sopenharmony_ci      { type: 'STATWATCHER', id: 'statwatcher:2', triggerAsyncId: null } ],
331cb0ef41Sopenharmony_ci  );
341cb0ef41Sopenharmony_ci}
35