GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: use spawnSyncAndAssert in windowsHide test · nodejs/node@359369e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-child-process-windows-hide.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-child-process-windows-hide.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-windows-hide.js
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ const internalCp = require('internal/child_process');
88
const cmd = process.execPath;
99
const args = ['-p', '42'];
1010
const options = { windowsHide: true };
11+
const { spawnSyncAndAssert } = require('../common/child_process');
1112

1213
// Since windowsHide isn't really observable, this test relies on monkey
1314
// patching spawn() and spawnSync() to verify that the flag is being passed
1415
// through correctly.
1516

1617
test('spawnSync() passes windowsHide correctly', (t) => {
1718
const spy = t.mock.method(internalCp, 'spawnSync');
18-
const child = cp.spawnSync(cmd, args, options);
1919

20-
assert.strictEqual(child.status, 0);
21-
assert.strictEqual(child.signal, null);
22-
assert.strictEqual(child.stdout.toString().trim(), '42');
23-
assert.strictEqual(child.stderr.toString().trim(), '');
20+
spawnSyncAndAssert(cmd, args, options, {
21+
stdout: '42',
22+
stderr: '',
23+
trim: true
24+
});
2425
assert.strictEqual(spy.mock.calls.length, 1);
2526
assert.strictEqual(spy.mock.calls[0].arguments[0].windowsHide, true);
2627
});

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.