summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-12-26 16:16:02 +0800
committerAnna Henningsen <anna@addaleax.net>2019-01-02 15:00:21 +0100
commitf131ea6fafce7e598cc2bd099869be3aa0922157 (patch)
treef240bb6707b4b27416a78b7c6b946cf563be5927
parentedde0651912aca116f7e23c548bc5b56407a8056 (diff)
downloadandroid-node-v8-f131ea6fafce7e598cc2bd099869be3aa0922157.tar.gz
android-node-v8-f131ea6fafce7e598cc2bd099869be3aa0922157.tar.bz2
android-node-v8-f131ea6fafce7e598cc2bd099869be3aa0922157.zip
test: make sure tmpdir is created before using it
Otherwise it throws ENOENT when the folder happens to be cleaned PR-URL: https://github.com/nodejs/node/pull/25224 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r--test/parallel/test-child-process-spawnsync-args.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/parallel/test-child-process-spawnsync-args.js b/test/parallel/test-child-process-spawnsync-args.js
index d8dbf9c6bd..96de8670f1 100644
--- a/test/parallel/test-child-process-spawnsync-args.js
+++ b/test/parallel/test-child-process-spawnsync-args.js
@@ -15,6 +15,8 @@ const tmpdir = require('../common/tmpdir');
const command = common.isWindows ? 'cd' : 'pwd';
const options = { cwd: tmpdir.path };
+tmpdir.refresh();
+
if (common.isWindows) {
// This test is not the case for Windows based systems
// unless the `shell` options equals to `true`
@@ -31,12 +33,13 @@ const testCases = [
const expectedResult = tmpdir.path.trim().toLowerCase();
const results = testCases.map((testCase) => {
- const { stdout, stderr } = spawnSync(
+ const { stdout, stderr, error } = spawnSync(
command,
testCase,
options
);
+ assert.ifError(error);
assert.deepStrictEqual(stderr, Buffer.alloc(0));
return stdout.toString().trim().toLowerCase();