summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-pretty-custom-stack.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-repl-pretty-custom-stack.js')
-rw-r--r--test/parallel/test-repl-pretty-custom-stack.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/parallel/test-repl-pretty-custom-stack.js b/test/parallel/test-repl-pretty-custom-stack.js
index b65287c5f5..0d2ada134f 100644
--- a/test/parallel/test-repl-pretty-custom-stack.js
+++ b/test/parallel/test-repl-pretty-custom-stack.js
@@ -5,6 +5,7 @@ const fixtures = require('../common/fixtures');
const assert = require('assert');
const repl = require('repl');
+const stackRegExp = /repl:[0-9]+:[0-9]+/g;
function run({ command, expected }) {
let accum = '';
@@ -23,7 +24,10 @@ function run({ command, expected }) {
});
r.write(`${command}\n`);
- assert.strictEqual(accum, expected);
+ assert.strictEqual(
+ accum.replace(stackRegExp, 'repl:*:*'),
+ expected.replace(stackRegExp, 'repl:*:*')
+ );
r.close();
}
@@ -44,8 +48,8 @@ const tests = [
{
// test .load for a file that throws
command: `.load ${fixtures.path('repl-pretty-stack.js')}`,
- expected: 'Thrown:\nError: Whoops!--->\nrepl:9:24--->\nd (repl:12:3)' +
- '--->\nc (repl:9:3)--->\nb (repl:6:3)--->\na (repl:3:3)\n'
+ expected: 'Thrown:\nError: Whoops!--->\nrepl:*:*--->\nd (repl:*:*)' +
+ '--->\nc (repl:*:*)--->\nb (repl:*:*)--->\na (repl:*:*)\n'
},
{
command: 'let x y;',
@@ -63,7 +67,7 @@ const tests = [
// test anonymous IIFE
{
command: '(function() { throw new Error(\'Whoops!\'); })()',
- expected: 'Thrown:\nError: Whoops!--->\nrepl:1:21\n'
+ expected: 'Thrown:\nError: Whoops!--->\nrepl:*:*\n'
}
];