summaryrefslogtreecommitdiff
path: root/test/parallel/test-trace-events-binding.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-trace-events-binding.js')
-rw-r--r--test/parallel/test-trace-events-binding.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/parallel/test-trace-events-binding.js b/test/parallel/test-trace-events-binding.js
index 163d9c4cbd..a6994d47b3 100644
--- a/test/parallel/test-trace-events-binding.js
+++ b/test/parallel/test-trace-events-binding.js
@@ -3,9 +3,7 @@ const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const fs = require('fs');
-
-if (!common.isMainThread)
- common.skip('process.chdir is not available in Workers');
+const path = require('path');
const CODE = `
const { internalBinding } = require('internal/test/binding');
@@ -18,17 +16,17 @@ const CODE = `
trace('b'.charCodeAt(0), 'missing',
'type-value', 10, {'extra-value': 20 });
`;
-const FILE_NAME = 'node_trace.1.log';
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
-process.chdir(tmpdir.path);
+const FILE_NAME = path.join(tmpdir.path, 'node_trace.1.log');
const proc = cp.spawn(process.execPath,
[ '--trace-event-categories', 'custom',
'--no-warnings',
'--expose-internals',
- '-e', CODE ]);
+ '-e', CODE ],
+ { cwd: tmpdir.path });
proc.once('exit', common.mustCall(() => {
assert(fs.existsSync(FILE_NAME));