-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make tests engine agnostic #16272
Make tests engine agnostic #16272
Changes from all commits
9231450
12cc6c0
8bde5ed
2ab4577
e8e6863
53c033c
ab32e20
b64b12e
ebc145f
c40983b
ef2da79
244cf83
399b292
d0d2b0a
4f21368
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,16 @@ const obj = {}; | |
decorateErrorStack(obj); | ||
assert.strictEqual(obj.stack, undefined); | ||
|
||
// Verify that the stack is decorated when possible | ||
// Verify that the stack is decorated when possible. | ||
function checkStack(stack) { | ||
const matches = stack.match(/var foo bar;/g); | ||
assert.strictEqual(Array.isArray(matches), true); | ||
assert.strictEqual(matches.length, 1); | ||
// Matching only on a minimal piece of the stack because the string will vary | ||
// greatly depending on the JavaScript engine. V8 includes `;` because it | ||
// displays the line of code (`var foo bar;`) that is causing a problem. | ||
// ChakraCore does not display the line of code but includes `;` in the phrase | ||
// `Expected ';' `. | ||
assert.ok(/;/g.test(stack)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the best we can do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @refack I guess that's something. I've added this: // Test that it's a multiline string.
assert.ok(/\n/g.test(stack)); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
// Test that it's a multiline string. | ||
assert.ok(/\n/g.test(stack)); | ||
} | ||
let err; | ||
const badSyntaxPath = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: should be "At least one line ... " or the assertion should be
> 1
.