Skip to content

Commit

Permalink
eliminate more internals from tests, since line numbers change the ex…
Browse files Browse the repository at this point in the history
…act node version.
  • Loading branch information
jamestalmage committed Jan 9, 2016
1 parent 74b6278 commit 5b6da68
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions test/long-stack-traces.js
Expand Up @@ -11,9 +11,11 @@ function internals() {
/[\\\/]long-stack-traces\.js:[0-9]+:[0-9]+\)?$/,
/[\\\/]internal-error\.js:[0-9]+:[0-9]+\)?$/,
/[\\\/]internal-then\.js:[0-9]+:[0-9]+\)?$/,
// TODO: Should this be a default internal?
/[\\\/]node_modules[\\\/]/,
// TODO: Should any of these be default internals?
/[\\\/]\.node-spawn-wrap-\w+-\w+[\\\/]node:[0-9]+:[0-9]+\)?$/,
/[\\\/]node_modules[\\\/]/
/internal[\\\/]module\.js:[0-9]+:[0-9]+\)?$/,
/node\.js:[0-9]+:[0-9]+\)?$/
]);
}

Expand All @@ -30,11 +32,7 @@ test('outdents lines after first "From previous event:"', async t => {
'From previous event:',
' outer (produce-long-stack-traces.js:7:27)',
'From previous event:',
' Object.<anonymous> (produce-long-stack-traces.js:6:36)',
// TODO: Should any of these be default internals?
' require (internal/module.js:12:17)',
' require (internal/module.js:12:17)',
' node.js:980:3'
' Object.<anonymous> (produce-long-stack-traces.js:6:36)'
]);

t.is(cleanedStack, expected);
Expand Down Expand Up @@ -69,10 +67,7 @@ test('removes empty "From previous event:" sections from the top', async t => {
'From previous event:',
' outer (produce-long-stack-traces.js:31:27)',
'From previous event:',
' Object.<anonymous> (produce-long-stack-traces.js:30:40)',
' require (internal/module.js:12:17)',
' require (internal/module.js:12:17)',
' node.js:980:3'
' Object.<anonymous> (produce-long-stack-traces.js:30:40)'
]);

t.is(cleanedStack, expected);
Expand All @@ -91,10 +86,7 @@ test('removes empty "From previous event:" sections from the middle', async t =>
'From previous event:',
' outer (produce-long-stack-traces.js:19:27)',
'From previous event:',
' Object.<anonymous> (produce-long-stack-traces.js:18:43)',
' require (internal/module.js:12:17)',
' require (internal/module.js:12:17)',
' node.js:980:3'
' Object.<anonymous> (produce-long-stack-traces.js:18:43)'
]);

t.is(cleanedStack, expected);
Expand Down

0 comments on commit 5b6da68

Please sign in to comment.