1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-23 15:16:54 -05:00
denoland-deno/js/custom_event_test.ts
Ryan Dahl c42a9d7370
Upgrade deno_std (#1892)
A major API change was that asserts are imported from testing/asserts.ts
now rather than testing/mod.ts and assertEqual as renamed to
assertEquals to conform to what is most common in JavaScript.
2019-03-06 20:48:46 -05:00

21 lines
678 B
TypeScript

// Copyright 2018 the Deno authors. All rights reserved. MIT license.
import { test, assertEquals } 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);
assertEquals(event.bubbles, true);
assertEquals(event.cancelable, true);
assertEquals(event.currentTarget, null);
assertEquals(event.detail, detail);
assertEquals(event.isTrusted, false);
assertEquals(event.target, null);
assertEquals(event.type, type);
});