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 common module API in test-child-process-exec-stdout-stderr-… · nodejs/node@5314754

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-child-process-exec-stdout-stderr-data-string.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-child-process-exec-stdout-stderr-data-string.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-exec-stdout-stderr-data-string.js
+4-14Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,10 @@ const common = require('../common');
44
const assert = require('assert');
55
const exec = require('child_process').exec;
66

7-
let stdoutCalls = 0;
8-
let stderrCalls = 0;
9-
107
const command = common.isWindows ? 'dir' : 'ls';
11-
exec(command).stdout.on('data', (data) => {
12-
stdoutCalls += 1;
13-
});
148

15-
exec('fhqwhgads').stderr.on('data', (data) => {
16-
assert.strictEqual(typeof data, 'string');
17-
stderrCalls += 1;
18-
});
9+
exec(command).stdout.on('data', common.mustCallAtLeast());
1910

20-
process.on('exit', () => {
21-
assert(stdoutCalls > 0);
22-
assert(stderrCalls > 0);
23-
});
11+
exec('fhqwhgads').stderr.on('data', common.mustCallAtLeast((data) => {
12+
assert.strictEqual(typeof data, 'string');
13+
}));

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.