aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-child-process-spawn-typeerror.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-07-17 15:33:46 -0700
committerJames M Snell <jasnell@gmail.com>2017-08-07 18:00:57 -0700
commit7535a94c8a54bb6346c8e60dbae1c32d6f508212 (patch)
treee455c85470c3256bb064516a8fa8e2c4c059532b /test/parallel/test-child-process-spawn-typeerror.js
parent7192e913f703c96eddff697c4ba0daef87930776 (diff)
downloadandroid-node-v8-7535a94c8a54bb6346c8e60dbae1c32d6f508212.tar.gz
android-node-v8-7535a94c8a54bb6346c8e60dbae1c32d6f508212.tar.bz2
android-node-v8-7535a94c8a54bb6346c8e60dbae1c32d6f508212.zip
test: begin normalizing fixtures use
Adds a new `../common/fixtures' module to begin normalizing `test/fixtures` use. Our test code is a bit inconsistent with regards to use of the fixtures directory. Some code uses `path.join()`, some code uses string concats, some other code uses template strings, etc. In mnay cases, significant duplication of code is seen when accessing fixture files, etc. This updates many (but by no means all) of the tests in the test suite to use the new consistent API. There are still many more to update, which would make an excelent Code-n-Learn exercise. PR-URL: https://github.com/nodejs/node/pull/14332 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Diffstat (limited to 'test/parallel/test-child-process-spawn-typeerror.js')
-rw-r--r--test/parallel/test-child-process-spawn-typeerror.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/parallel/test-child-process-spawn-typeerror.js b/test/parallel/test-child-process-spawn-typeerror.js
index 93b26107a7..d8ae4c758c 100644
--- a/test/parallel/test-child-process-spawn-typeerror.js
+++ b/test/parallel/test-child-process-spawn-typeerror.js
@@ -22,17 +22,16 @@
'use strict';
const common = require('../common');
const assert = require('assert');
-const child_process = require('child_process');
-const spawn = child_process.spawn;
-const fork = child_process.fork;
-const execFile = child_process.execFile;
+const { spawn, fork, execFile } = require('child_process');
+const fixtures = require('../common/fixtures');
const cmd = common.isWindows ? 'rundll32' : 'ls';
const invalidcmd = 'hopefully_you_dont_have_this_on_your_machine';
const invalidArgsMsg = /Incorrect value of args option/;
const invalidOptionsMsg = /"options" argument must be an object/;
const invalidFileMsg =
/^TypeError: "file" argument must be a non-empty string$/;
-const empty = `${common.fixturesDir}/empty.js`;
+
+const empty = fixtures.path('empty.js');
assert.throws(function() {
const child = spawn(invalidcmd, 'this is not an array');