mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: adapt test-repl-pretty-*stack to V8 changes
PR-URL: https://github.com/nodejs/node/pull/44741 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
71c193e581
commit
96ef25793d
@ -24,10 +24,17 @@ function run({ command, expected }) {
|
||||
});
|
||||
|
||||
r.write(`${command}\n`);
|
||||
if (typeof expected === 'string') {
|
||||
assert.strictEqual(
|
||||
accum.replace(stackRegExp, '$1:*:*'),
|
||||
expected.replace(stackRegExp, '$1:*:*')
|
||||
);
|
||||
} else {
|
||||
assert.match(
|
||||
accum.replace(stackRegExp, '$1:*:*'),
|
||||
expected
|
||||
);
|
||||
}
|
||||
r.close();
|
||||
}
|
||||
|
||||
@ -53,8 +60,7 @@ const tests = [
|
||||
},
|
||||
{
|
||||
command: 'let x y;',
|
||||
expected: 'let x y;\n ^\n\n' +
|
||||
'Uncaught SyntaxError: Unexpected identifier\n'
|
||||
expected: /let x y;\n {6}\^\n\nUncaught SyntaxError: Unexpected identifier.*\n/
|
||||
},
|
||||
{
|
||||
command: 'throw new Error(\'Whoops!\')',
|
||||
|
@ -26,10 +26,17 @@ function run({ command, expected, ...extraREPLOptions }, i) {
|
||||
|
||||
r.write(`${command}\n`);
|
||||
console.log(i);
|
||||
if (typeof expected === 'string') {
|
||||
assert.strictEqual(
|
||||
accum.replace(stackRegExp, '$1*:*'),
|
||||
expected.replace(stackRegExp, '$1*:*')
|
||||
);
|
||||
} else {
|
||||
assert.match(
|
||||
accum.replace(stackRegExp, '$1*:*'),
|
||||
expected
|
||||
);
|
||||
}
|
||||
r.close();
|
||||
}
|
||||
|
||||
@ -43,8 +50,7 @@ const tests = [
|
||||
},
|
||||
{
|
||||
command: 'let x y;',
|
||||
expected: 'let x y;\n ^\n\n' +
|
||||
'Uncaught SyntaxError: Unexpected identifier\n'
|
||||
expected: /^let x y;\n {6}\^\n\nUncaught SyntaxError: Unexpected identifier.*\n/
|
||||
},
|
||||
{
|
||||
command: 'throw new Error(\'Whoops!\')',
|
||||
|
Loading…
Reference in New Issue
Block a user