node/test/parallel/test-trace-events-none.js
Rich Trott a1b0d5da07
test: move tmpdir to submodule of common
Move tmpdir functionality to its own module (common/tmpdir).

Backport-PR-URL: https://github.com/nodejs/node/pull/19488
PR-URL: https://github.com/nodejs/node/pull/17856
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-03-29 23:28:22 -04:00

22 lines
584 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const CODE =
'setTimeout(() => { for (var i = 0; i < 100000; i++) { "test" + i } }, 1)';
const FILE_NAME = 'node_trace.1.log';
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
process.chdir(tmpdir.path);
const proc_no_categories = cp.spawn(
process.execPath,
[ '--trace-events-enabled', '--trace-event-categories', '""', '-e', CODE ]
);
proc_no_categories.once('exit', common.mustCall(() => {
assert(!common.fileExists(FILE_NAME));
}));