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 c10b131

Browse filesBrowse files
joyeecheungaddaleax
authored andcommitted
test: make sure tmpdir is created before using it
Otherwise it throws ENOENT when the folder happens to be cleaned PR-URL: #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>
1 parent 1ccaf9a commit c10b131
Copy full SHA for c10b131

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-child-process-spawnsync-args.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-spawnsync-args.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const tmpdir = require('../common/tmpdir');
1515
const command = common.isWindows ? 'cd' : 'pwd';
1616
const options = { cwd: tmpdir.path };
1717

18+
tmpdir.refresh();
19+
1820
if (common.isWindows) {
1921
// This test is not the case for Windows based systems
2022
// unless the `shell` options equals to `true`
@@ -31,12 +33,13 @@ const testCases = [
3133
const expectedResult = tmpdir.path.trim().toLowerCase();
3234

3335
const results = testCases.map((testCase) => {
34-
const { stdout, stderr } = spawnSync(
36+
const { stdout, stderr, error } = spawnSync(
3537
command,
3638
testCase,
3739
options
3840
);
3941

42+
assert.ifError(error);
4043
assert.deepStrictEqual(stderr, Buffer.alloc(0));
4144

4245
return stdout.toString().trim().toLowerCase();

0 commit comments

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