MCPcopy Create free account
hub / github.com/nodejs/node / checkOutput

Function checkOutput

test/parallel/test-snapshot-dns-lookup-localhost.js:18–26  ·  view source on GitHub ↗
(stderr, stdout)

Source from the content-addressed store, hash-verified

16
17tmpdir.refresh();
18function checkOutput(stderr, stdout) {
19 // We allow failures as it's not always possible to resolve localhost.
20 // Functional tests are done in test/internet instead.
21 if (!stderr.startsWith('error:')) {
22 assert.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/);
23 assert.match(stdout, /family: 4/);
24 assert.strictEqual(stdout.trim().split('\n').length, 2);
25 }
26}
27{
28 const { stderr, stdout } = buildSnapshot(entry, env);
29 checkOutput(stderr, stdout);

Calls 2

matchMethod · 0.65
splitMethod · 0.45

Tested by

no test coverage detected