test262/test/built-ins/Promise/withResolvers/result.js

18 lines
533 B
JavaScript
Raw Normal View History

// Copyright (C) 2023 Peter Klecha. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Promise.withResolvers result is an object with keys "promise", "reject", and "resolve"
features: [promise-with-resolvers]
---*/
var instance = Promise.withResolvers();
assert.sameValue(typeof instance, "object");
assert.notSameValue(instance, null);
assert(Object.hasOwn(instance, "promise"));
assert(Object.hasOwn(instance, "resolve"));
assert(Object.hasOwn(instance, "reject"));