| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9372aee commit 63ef099
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,3 +87,19 @@ assert.strictEqual(ret, msg + '\n', | |||
| 87 | 87 | execSync('exit -1', {stdio: 'ignore'}); | |
| 88 | 88 | }, /Command failed: exit -1/); | |
| 89 | 89 | } | |
| 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 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments