From 1d19b1011bd7df50598f5981408c2d78c35b76d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 1 Nov 2023 20:25:09 +0100 Subject: chore: upgrade deno_core (#21036) Updated to deno_core 0.224.0 and V8 12.0. --------- Co-authored-by: Aapo Alasuutari --- cli/tests/unit/globals_test.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'cli/tests/unit') 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!"); + } +}); -- cgit v1.2.3