Skip to content

Commit 21ac403

Browse files
committed
[Tests] handle stack trace variation in node <= 0.8
1 parent d7c2fd3 commit 21ac403

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

test/anonymous-fn.js

-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ tap.test('inside anonymous functions', function (tt) {
1212
var tc = function (rows) {
1313
var body = stripFullStack(rows.toString('utf8'));
1414

15-
// Handle stack trace variation in Node v0.8
16-
body = body.replace(
17-
/at(:?) Test\.module\.exports/g,
18-
'at$1 Test.<anonymous>'
19-
);
20-
2115
tt.same(body, [
2216
'TAP version 13',
2317
'# wrapped test failure',

test/common.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,9 @@ module.exports.stripFullStack = function (output) {
5757
return !hasPrior;
5858
});
5959

60-
return deduped.join('\n');
60+
return deduped.join('\n').replace(
61+
// Handle stack trace variation in Node v0.8
62+
/at(:?) Test\.(?:module\.exports|tap\.test\.err\.code)/g,
63+
'at$1 Test.<anonymous>'
64+
);
6165
};

0 commit comments

Comments
 (0)