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: add coverage for execFileSync() errors · nodejs/node@527db40

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/sequential
    • test-child-process-execsync.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/sequential/test-child-process-execsync.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-child-process-execsync.js
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,19 @@ assert.strictEqual(ret, msg + '\n',
8787
execSync('exit -1', {stdio: 'ignore'});
8888
}, /Command failed: exit -1/);
8989
})();
90+
91+
// Verify the execFileSync() behavior when the child exits with a non-zero code.
92+
{
93+
const args = ['-e', 'process.exit(1)'];
94+
95+
assert.throws(() => {
96+
execFileSync(process.execPath, args);
97+
}, (err) => {
98+
const msg = `Command failed: ${process.execPath} ${args.join(' ')}`;
99+
100+
assert(err instanceof Error);
101+
assert.strictEqual(err.message.trim(), msg);
102+
assert.strictEqual(err.status, 1);
103+
return true;
104+
});
105+
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — 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.