summaryrefslogtreecommitdiff
path: root/cli/js/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/tests')
-rw-r--r--cli/js/tests/event_target_test.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/cli/js/tests/event_target_test.ts b/cli/js/tests/event_target_test.ts
index 45f626502..ece4b5dba 100644
--- a/cli/js/tests/event_target_test.ts
+++ b/cli/js/tests/event_target_test.ts
@@ -35,12 +35,24 @@ unitTest(function constructedEventTargetCanBeUsedAsExpected(): void {
assertEquals(callCount, 2);
});
+// TODO(ry) Should AddEventListenerOptions and EventListenerOptions be exposed
+// from the public API?
+
+interface AddEventListenerOptions extends EventListenerOptions {
+ once?: boolean;
+ passive?: boolean;
+}
+
+interface EventListenerOptions {
+ capture?: boolean;
+}
+
unitTest(function anEventTargetCanBeSubclassed(): void {
class NicerEventTarget extends EventTarget {
on(
type: string,
callback: ((e: Event) => void) | null,
- options?: __domTypes.AddEventListenerOptions
+ options?: AddEventListenerOptions
): void {
this.addEventListener(type, callback, options);
}
@@ -48,7 +60,7 @@ unitTest(function anEventTargetCanBeSubclassed(): void {
off(
type: string,
callback: ((e: Event) => void) | null,
- options?: __domTypes.EventListenerOptions
+ options?: EventListenerOptions
): void {
this.removeEventListener(type, callback, options);
}