GeezerVison is showing github.com — test: adapt test-repl-pretty-*stack to V8 changes · nodejs/node@96ef257
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -24,10 +24,17 @@ function run({ command, expected }) { | 24 | 24 | }); | 25 | 25 |
| 26 | 26 | 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 | + } | 31 | 38 | r.close(); | 32 | 39 | } | 33 | 40 |
| @@ -53,8 +60,7 @@ const tests = [ | 53 | 60 | }, | 54 | 61 | { | 55 | 62 | 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/ | 58 | 64 | }, | 59 | 65 | { | 60 | 66 | command: 'throw new Error(\'Whoops!\')', | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-repl-pretty-stack.js +12-6Lines changed: 12 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,10 +26,17 @@ function run({ command, expected, ...extraREPLOptions }, i) { | 26 | 26 |
| 27 | 27 | r.write(`${command}\n`); | 28 | 28 | 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 | + } | 33 | 40 | r.close(); | 34 | 41 | } | 35 | 42 |
| @@ -43,8 +50,7 @@ const tests = [ | 43 | 50 | }, | 44 | 51 | { | 45 | 52 | 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/ | 48 | 54 | }, | 49 | 55 | { | 50 | 56 | command: 'throw new Error(\'Whoops!\')', | |
|