Skip to content

Commit a7e64f0

Browse files
committed
test errors
1 parent 35797a6 commit a7e64f0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts"
1+
export { assertEquals, assertThrows } from "https://deno.land/[email protected]/testing/asserts.ts"

test/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "../deps.ts"
1+
import { assertEquals, assertThrows } from "../deps.ts"
22
import { TypedCustomEvent, TypedEventTarget } from "../mod.ts"
33

44
type Events = {
@@ -13,15 +13,15 @@ const e = new TypedEventTarget<Events>()
1313
*/
1414
// Incorrect Syntax
1515
// @ts-expect-error reason: test
16-
e.dispatchEvent(new TypedCustomEvent("Hi", "Hello"))
16+
assertThrows(() => e.dispatchEvent(new TypedCustomEvent("Hi", "Hello")))
1717
// @ts-expect-error reason: test
18-
e.dispatchEvent(new TypedCustomEvent("Hello", true))
18+
assertThrows(() => e.dispatchEvent(new TypedCustomEvent("Hello", true)))
1919

2020
// Invalid Types
2121
// @ts-expect-error reason: test
22-
e.dispatchEvent(new TypedCustomEvent("Hi", 1))
22+
e.dispatchEvent(new TypedCustomEvent("Hi", {detail: 1}))
2323
// @ts-expect-error reason: test
24-
e.dispatchEvent(new TypedCustomEvent("Hello", "Hi"))
24+
e.dispatchEvent(new TypedCustomEvent("Hello", {detail: "Hi"}))
2525
// @ts-expect-error reason: test
2626
e.addEventListener("Hi", (value: string) => value)
2727

0 commit comments

Comments
 (0)