Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: Move CheckFailed Error into its own file. (#1663)
* dev: Move CheckFailed Error into its own file. * Update bin.js
- Loading branch information
Showing
4 changed files
with
21 additions
and
6 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
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,11 @@ | ||
import { CheckFailed } from './errors'; | ||
|
||
describe('errors', () => { | ||
test.each` | ||
ErrorClass | params | ||
${CheckFailed} | ${['no matches']} | ||
`('new', ({ ErrorClass, params }) => { | ||
const e = new ErrorClass(...params); | ||
expect(e instanceof Error).toBe(true); | ||
}); | ||
}); |
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,5 @@ | ||
export class CheckFailed extends Error { | ||
constructor(message: string, readonly exitCode: number = 1) { | ||
super(message); | ||
} | ||
} |