mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Enable TS strict mode by default (#3899)
Fixes #3324 Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
This commit is contained in:
parent
852823fa50
commit
90125566bb
56 changed files with 314 additions and 179 deletions
|
@ -1,5 +1,5 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { test, assertEquals, assertNotEquals } from "./test_util.ts";
|
||||
import { test, assertEquals, assert } from "./test_util.ts";
|
||||
|
||||
test(function eventInitializedWithType(): void {
|
||||
const type = "click";
|
||||
|
@ -70,7 +70,8 @@ test(function eventPreventDefaultSuccess(): void {
|
|||
});
|
||||
|
||||
test(function eventInitializedWithNonStringType(): void {
|
||||
const type = undefined;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const type: any = undefined;
|
||||
const event = new Event(type);
|
||||
|
||||
assertEquals(event.isTrusted, false);
|
||||
|
@ -84,12 +85,12 @@ test(function eventInitializedWithNonStringType(): void {
|
|||
// ref https://github.com/web-platform-tests/wpt/blob/master/dom/events/Event-isTrusted.any.js
|
||||
test(function eventIsTrusted(): void {
|
||||
const desc1 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted");
|
||||
assertNotEquals(desc1, undefined);
|
||||
assert(desc1);
|
||||
assertEquals(typeof desc1.get, "function");
|
||||
|
||||
const desc2 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted");
|
||||
assertNotEquals(desc2, undefined);
|
||||
assertEquals(typeof desc2.get, "function");
|
||||
assert(desc2);
|
||||
assertEquals(typeof desc2!.get, "function");
|
||||
|
||||
assertEquals(desc1.get, desc2.get);
|
||||
assertEquals(desc1!.get, desc2!.get);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue