GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: adapt test-repl-pretty-*stack to V8 changes · nodejs/node@96ef257

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-repl-pretty-custom-stack.js
    • test-repl-pretty-stack.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-repl-pretty-custom-stack.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-pretty-custom-stack.js
+12-6Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,17 @@ function run({ command, expected }) {
2424
});
2525

2626
r.write(`${command}\n`);
27-
assert.strictEqual(
28-
accum.replace(stackRegExp, '$1:*:*'),
29-
expected.replace(stackRegExp, '$1:*:*')
30-
);
27+
if (typeof expected === 'string') {
28+
assert.strictEqual(
29+
accum.replace(stackRegExp, '$1:*:*'),
30+
expected.replace(stackRegExp, '$1:*:*')
31+
);
32+
} else {
33+
assert.match(
34+
accum.replace(stackRegExp, '$1:*:*'),
35+
expected
36+
);
37+
}
3138
r.close();
3239
}
3340

@@ -53,8 +60,7 @@ const tests = [
5360
},
5461
{
5562
command: 'let x y;',
56-
expected: 'let x y;\n ^\n\n' +
57-
'Uncaught SyntaxError: Unexpected identifier\n'
63+
expected: /let x y;\n {6}\^\n\nUncaught SyntaxError: Unexpected identifier.*\n/
5864
},
5965
{
6066
command: 'throw new Error(\'Whoops!\')',
Collapse file

‎test/parallel/test-repl-pretty-stack.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-pretty-stack.js
+12-6Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ function run({ command, expected, ...extraREPLOptions }, i) {
2626

2727
r.write(`${command}\n`);
2828
console.log(i);
29-
assert.strictEqual(
30-
accum.replace(stackRegExp, '$1*:*'),
31-
expected.replace(stackRegExp, '$1*:*')
32-
);
29+
if (typeof expected === 'string') {
30+
assert.strictEqual(
31+
accum.replace(stackRegExp, '$1*:*'),
32+
expected.replace(stackRegExp, '$1*:*')
33+
);
34+
} else {
35+
assert.match(
36+
accum.replace(stackRegExp, '$1*:*'),
37+
expected
38+
);
39+
}
3340
r.close();
3441
}
3542

@@ -43,8 +50,7 @@ const tests = [
4350
},
4451
{
4552
command: 'let x y;',
46-
expected: 'let x y;\n ^\n\n' +
47-
'Uncaught SyntaxError: Unexpected identifier\n'
53+
expected: /^let x y;\n {6}\^\n\nUncaught SyntaxError: Unexpected identifier.*\n/
4854
},
4955
{
5056
command: 'throw new Error(\'Whoops!\')',

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.