Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4825786

Browse filesBrowse files
juanarbolRafaelGSS
authored andcommitted
test: improve test coverage in test-child-process-spawn-argv0.js
PR-URL: #44955 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent f0c18f0 commit 4825786
Copy full SHA for 4825786

File tree

Expand file treeCollapse file tree

1 file changed

+10
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-child-process-spawn-argv0.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-spawn-argv0.js
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
require('../common');
2+
const common = require('../common');
33
const assert = require('assert');
44
const cp = require('child_process');
55

@@ -16,3 +16,12 @@ assert.strictEqual(noArgv0.stdout.toString().trim(), process.execPath);
1616
const withArgv0 = cp.spawnSync(process.execPath, [__filename, 'child'],
1717
{ argv0: 'withArgv0' });
1818
assert.strictEqual(withArgv0.stdout.toString().trim(), 'withArgv0');
19+
20+
assert.throws(() => {
21+
cp.spawnSync(process.execPath, [__filename, 'child'], { argv0: [] });
22+
}, {
23+
code: 'ERR_INVALID_ARG_TYPE',
24+
name: 'TypeError',
25+
message: 'The "options.argv0" property must be of type string.' +
26+
common.invalidArgTypeHelper([])
27+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.