/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.5.1
test/async-hooks/test-graph.statwatcher.js
34 строки
774 B
Antoine du Hamel
test: add trailing commas in async-hooks tests (#45549)
21 ноя 2022, 20:43
Не верифицирован
21 ноя 2022, 20:43
cf46746
Код
Авторство
О чём код?
'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() { } // Install first file watcher fs.watchFile(__filename, onchange); // Install second file watcher fs.watchFile(commonPath, onchange); // Remove first file watcher fs.unwatchFile(__filename); // Remove second file watcher fs.unwatchFile(commonPath); process.on('exit', onexit); function onexit() { hooks.disable(); verifyGraph( hooks, [ { type: 'STATWATCHER', id: 'statwatcher:1', triggerAsyncId: null }, { type: 'STATWATCHER', id: 'statwatcher:2', triggerAsyncId: null } ], ); }