-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle non-zero exit from commands run in a way needed by execa
Fixes #197
- Loading branch information
1 parent
39ede7d
commit 33c6152
Showing
2 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
const expect = require('chai').expect; | ||
|
||
describe('utils/run', () => { | ||
it('rejects if command exits non-zero', () => { | ||
let run = require('../../lib/utils/run'); | ||
|
||
return run('exit 1', [], {}).then(() => { | ||
expect(true).to.equal(false, 'Should not succeed'); | ||
}).catch((res) => { | ||
expect(res).to.equal(1, 'Should reject with exit code'); | ||
}); | ||
}); | ||
}); |