We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b70fdc0 + 9f194a7 commit d1474b3Copy full SHA for d1474b3
testLib/sharedTestCases.js
@@ -284,7 +284,18 @@ module.exports = function () {
284
try {
285
throwError();
286
} catch (err) {
287
- expect(err.stack.split("\n")[1]).to.match(/:6:26/);
+
288
+ // Firefox implements a different error-stack format,
289
+ // but does offer line and column numbers on errors: we use
290
+ // those instead.
291
+ if (err.lineNumber !== undefined && err.columnNumber !== undefined) {
292
+ expect(err.lineNumber).to.equal(6)
293
+ expect(err.columnNumber).to.equal(26)
294
+ }
295
+ // This is for the V8 stack trace format (Node, Chrome)
296
+ else {
297
+ expect(err.stack.split("\n")[1]).to.match(/:6:26/);
298
299
}
300
});
301
0 commit comments