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

LibJS/Tests: Test ShadowRealm.prototype.evaluate() this value type check

This commit is contained in:
Linus Groh 2021-10-15 00:12:28 +01:00
parent 09536f5f48
commit fb85fd4867

View file

@ -56,6 +56,12 @@ describe("normal behavior", () => {
});
describe("errors", () => {
test("this value must be a ShadowRealm object", () => {
expect(() => {
ShadowRealm.prototype.evaluate.call("foo");
}).toThrowWithMessage(TypeError, "Not an object of type ShadowRealm");
});
test("throws for non-string input", () => {
const shadowRealm = new ShadowRealm();
const values = [