diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-11-01 20:25:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 20:25:09 +0100 |
commit | 1d19b1011bd7df50598f5981408c2d78c35b76d2 (patch) | |
tree | fd08d835b76abb0b95f88fa666580b251ae2aa50 /cli/tests/unit | |
parent | 01d3e0f317ca180bbf0ac8a17c6651869110e02f (diff) |
chore: upgrade deno_core (#21036)
Updated to deno_core 0.224.0 and V8 12.0.
---------
Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
Diffstat (limited to 'cli/tests/unit')
-rw-r--r-- | cli/tests/unit/globals_test.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cli/tests/unit/globals_test.ts b/cli/tests/unit/globals_test.ts index 184b662a4..e5ff2cc8e 100644 --- a/cli/tests/unit/globals_test.ts +++ b/cli/tests/unit/globals_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // deno-lint-ignore-file no-window-prefix -import { assert, assertEquals } from "./test_util.ts"; +import { assert, assertEquals, assertRejects } from "./test_util.ts"; Deno.test(function globalThisExists() { assert(globalThis != null); @@ -140,3 +140,16 @@ Deno.test(function windowNameIsDefined() { assertEquals(window.name, ""); assertEquals(name, ""); }); + +Deno.test(async function promiseWithResolvers() { + { + const { promise, resolve } = Promise.withResolvers(); + resolve(true); + assert(await promise); + } + { + const { promise, reject } = Promise.withResolvers(); + reject(new Error("boom!")); + await assertRejects(() => promise, Error, "boom!"); + } +}); |