diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-08-10 18:33:08 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 10:33:08 +0200 |
commit | 465cf9a6fe2d77f4c3cdaeb8eea60bd2b8697608 (patch) | |
tree | c3ea98533e1ecdf47f5ca9ff8afa0374d41b278b /cli/tests/unit/esnext_test.ts | |
parent | 453dfaa960245df2f8c1b8f505984b1cae45db67 (diff) |
feat: add new esnext types (#11627)
Diffstat (limited to 'cli/tests/unit/esnext_test.ts')
-rw-r--r-- | cli/tests/unit/esnext_test.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cli/tests/unit/esnext_test.ts b/cli/tests/unit/esnext_test.ts index 558c678bc..5d858e267 100644 --- a/cli/tests/unit/esnext_test.ts +++ b/cli/tests/unit/esnext_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -import { assertEquals, unitTest } from "./test_util.ts"; +import { assert, assertEquals, unitTest } from "./test_util.ts"; // TODO(@kitsonk) remove when we are no longer patching TypeScript to have // these types available. @@ -10,3 +10,14 @@ unitTest(function typeCheckingEsNextArrayString() { const b = ["a", "b", "c", "d", "e", "f"]; assertEquals(b.at(-1), "f"); }); + +unitTest(function objectHasOwn() { + const a = { a: 1 }; + assert(Object.hasOwn(a, "a")); + assert(!Object.hasOwn(a, "b")); +}); + +unitTest(function errorCause() { + const e = new Error("test", { cause: "something" }); + assertEquals(e.cause, "something"); +}); |