1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:17:45 +00:00

LibJS: Don't coerce this value to object in Promise.resolve()

This commit is contained in:
Linus Groh 2021-11-14 00:58:15 +00:00
parent cd391aa8ef
commit 53ec432e8d
2 changed files with 13 additions and 3 deletions

View file

@ -31,3 +31,11 @@ describe("normal behavior", () => {
expect(fulfillmentValue).toBe("Some value");
});
});
describe("errors", () => {
test("this value must be an object", () => {
expect(() => {
Promise.resolve.call("foo");
}).toThrowWithMessage(TypeError, "foo is not an object");
});
});