-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: log renamed to logAndExit
- Loading branch information
Showing
6 changed files
with
91 additions
and
37 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,5 @@ | ||
import epicfail, { logAndExit } from '../../dist'; | ||
|
||
epicfail(); | ||
|
||
logAndExit('nailed', { name: 'NiceError' }); |
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,17 @@ | ||
import execa from 'execa'; | ||
import { join } from 'path'; | ||
import strip from 'strip-ansi'; | ||
|
||
let res: execa.ExecaReturnValue; | ||
|
||
describe('logAndExit', () => { | ||
beforeAll(async () => { | ||
const runnable = join(__dirname, 'cli.js'); | ||
res = await execa('node', ['-r', 'esm', runnable]); | ||
}); | ||
|
||
it('with title', () => { | ||
expect(strip(res.stdout)).toEqual(`# NiceError | ||
nailed`); | ||
}); | ||
}); |
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,6 @@ | ||
{ | ||
"name": "test", | ||
"version": "1.0.0", | ||
"main": "cli.js", | ||
"bugs": "https://github.com/uetchy/simple/issues" | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import handleErrors, { log } from '../..'; | ||
import handleErrors, { logAndExit } from '../..'; | ||
|
||
handleErrors(); | ||
|
||
log('Test'); | ||
logAndExit('Test'); |