Skip to content

Commit 157e35f

Browse files
committed
fix error type test
1 parent 2b5b598 commit 157e35f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

resources/test/tests/unit/basic.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
assert_equals(typeof WebIDL2.parse, "function");
2525
}, 'WebIDL2 namespace should have a parse method');
2626
test(function() {
27-
assert_throws(new TypeError(), function() { WebIDL2.parse("I'm a syntax error"); });
27+
try {
28+
WebIDL2.parse("I'm a syntax error");
29+
throw new Error("Web IDL didn't throw");
30+
} catch (e) {
31+
assert_true(e.constructor.name === "WebIDLParseError");
32+
}
2833
}, 'WebIDL2 parse method should bail on incorrect WebIDL');
2934
test(function() {
3035
assert_equals(typeof WebIDL2.parse("interface Foo {};"), "object");

0 commit comments

Comments
 (0)