0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/async-hooks/test-graph.fsreq-readFile.js
Jon Moss f479050916 src: rename PROVIDER_FSREQWRAP to PROVIDER_FSREQCALLBACK
PR-URL: https://github.com/nodejs/node/pull/21971
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-08-01 15:07:14 -04:00

27 lines
683 B
JavaScript

'use strict';
const common = require('../common');
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
const fs = require('fs');
const hooks = initHooks();
hooks.enable();
fs.readFile(__filename, common.mustCall(onread));
function onread() {}
process.on('exit', onexit);
function onexit() {
hooks.disable();
verifyGraph(
hooks,
[ { type: 'FSREQCALLBACK', id: 'fsreq:1', triggerAsyncId: null },
{ type: 'FSREQCALLBACK', id: 'fsreq:2', triggerAsyncId: 'fsreq:1' },
{ type: 'FSREQCALLBACK', id: 'fsreq:3', triggerAsyncId: 'fsreq:2' },
{ type: 'FSREQCALLBACK', id: 'fsreq:4', triggerAsyncId: 'fsreq:3' } ]
);
}