File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 1- import { assertEquals } from "../deps.ts"
1+ import { assertEquals , assertThrows } from "../deps.ts"
22import { TypedCustomEvent , TypedEventTarget } from "../mod.ts"
33
44type 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
2626e . addEventListener ( "Hi" , ( value : string ) => value )
2727
You can’t perform that action at this time.
0 commit comments