mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
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>
22 lines
584 B
JavaScript
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));
|
|
}));
|