Skip to content

Commit

Permalink
Merge pull request #171 from rensbaardman/stack-trace-test-firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnns authored Dec 18, 2021
2 parents b70fdc0 + 9f194a7 commit d1474b3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion testLib/sharedTestCases.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,18 @@ module.exports = function () {
try {
throwError();
} catch (err) {
expect(err.stack.split("\n")[1]).to.match(/:6:26/);

// Firefox implements a different error-stack format,
// but does offer line and column numbers on errors: we use
// those instead.
if (err.lineNumber !== undefined && err.columnNumber !== undefined) {
expect(err.lineNumber).to.equal(6)
expect(err.columnNumber).to.equal(26)
}
// This is for the V8 stack trace format (Node, Chrome)
else {
expect(err.stack.split("\n")[1]).to.match(/:6:26/);
}
}
});

Expand Down

0 comments on commit d1474b3

Please sign in to comment.