Skip to content

Commit

Permalink
fix: fixed exit
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Apr 6, 2018
1 parent 47fad1a commit b30b892
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/exit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default (code = 0) => ({
expect(process.exitCode).to.equal(code)
throw new Error(`Expected to exit with code ${code} but it ran without exiting`)
},
catch(ctx: {error: Error}) {
expect(ctx.error.message).to.equal(`EEXIT: ${code}`)
catch(ctx: {error: any}) {
if (!ctx.error.oclif || ctx.error.oclif.exit === undefined) throw ctx.error
expect(ctx.error.oclif.exit).to.equal(code)
},
})

0 comments on commit b30b892

Please sign in to comment.