Skip to content

Commit 922631c

Browse files
committed
Test execvp error code
1 parent bf729ab commit 922631c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/exec.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ describe('exec', () => {
1010
stdout: 'exec.js\nexec.spec.js\n'
1111
});
1212
});
13+
14+
test('the execvp error code is in the error message if the call fails', async () => {
15+
await expect(() => execAsync('node tests/exec.js foo')).rejects.toThrow(
16+
'execvp failed with code ENOENT: No such file or directory'
17+
);
18+
});
1319
});

0 commit comments

Comments
 (0)