Skip to content

Commit 5cb1587

Browse files
Fixed tests that were failing on Safari
1 parent 3b698a2 commit 5cb1587

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/utils/host.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const { host } = require("@jsdevtools/host-environment");
44
const sampleError = getSampleError();
5+
const sampleCustomError = getSampleCustomError();
56

67
module.exports = Object.assign({}, host, {
78
error: {
@@ -64,14 +65,18 @@ module.exports = Object.assign({}, host, {
6465
*
6566
* As of April 2020, only Firefox does this
6667
*/
67-
includesClassNames: sampleError.stack.includes("CustomError"),
68+
includesClassNames: sampleCustomError.stack.includes("MyCustomError"),
6869
}
6970
},
7071
});
7172

7273
function getSampleError () {
73-
class CustomError extends Error {}
74-
return new CustomError("THIS IS THE MESSAGE");
74+
return new Error("THIS IS THE MESSAGE");
75+
}
76+
77+
function getSampleCustomError () {
78+
class MyCustomError extends Error {}
79+
return new MyCustomError("THIS IS THE MESSAGE");
7580
}
7681

7782
function hasKey (error, key) {

0 commit comments

Comments
 (0)