-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logger.js: fix beautifyStack on Windows. Fixes: #255
The RegExp did not take into account Windows Drive Letters.
- Loading branch information
1 parent
60b2337
commit 832c597
Showing
2 changed files
with
28 additions
and
1 deletion.
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,25 @@ | ||
'use strict'; | ||
var test = require('tap').test; | ||
var logger = require('../lib/logger'); | ||
|
||
test('beautify stack - removes uninteresting lines', function (t) { | ||
try { | ||
fooFunc(); | ||
} catch (e) { | ||
var stack = logger._beautifyStack(e.stack); | ||
t.match(stack, /fooFunc/); | ||
t.match(stack, /barFunc/); | ||
t.match(e.stack, /Module._compile/); | ||
t.notMatch(stack, /Module\._compile/); | ||
t.end(); | ||
} | ||
}); | ||
|
||
function fooFunc() { | ||
barFunc(); | ||
} | ||
|
||
function barFunc() { | ||
throw new Error(); | ||
} | ||
|