1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00
denoland-deno/js/custom_event_test.ts
2019-01-23 06:20:53 -06:00

21 lines
670 B
TypeScript

// Copyright 2018 the Deno authors. All rights reserved. MIT license.
import { test, assertEqual } from "./test_util.ts";
test(function customEventInitializedWithDetail() {
const type = "touchstart";
const detail = { message: "hello" };
const customEventDict = new CustomEventInit({
bubbles: true,
cancelable: true,
detail
});
const event = new CustomEvent(type, customEventDict);
assertEqual(event.bubbles, true);
assertEqual(event.cancelable, true);
assertEqual(event.currentTarget, null);
assertEqual(event.detail, detail);
assertEqual(event.isTrusted, false);
assertEqual(event.target, null);
assertEqual(event.type, type);
});