1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

LibJS: Add more test matchers

This commit is contained in:
Matthew Olsson 2020-07-03 23:13:06 -07:00 committed by Andreas Kling
parent 5e971c91e3
commit fc08222f46
8 changed files with 200 additions and 46 deletions

View file

@ -1,8 +1,8 @@
describe("[[Has]] trap normal behavior", () => {
test("forwarding when not defined in handler", () => {
expect("foo" in new Proxy({}, { has: null })).toBe(false);
expect("foo" in new Proxy({}, { has: undefined})).toBe(false);
expect("foo" in new Proxy({}, {})).toBe(false);
expect("foo" in new Proxy({}, { has: null })).toBeFalse();
expect("foo" in new Proxy({}, { has: undefined})).toBeFalse();
expect("foo" in new Proxy({}, {})).toBeFalse();
});
test("correct arguments supplied to trap", () => {
@ -30,8 +30,8 @@ describe("[[Has]] trap normal behavior", () => {
}
});
expect("foo" in p).toBe(false);
expect("foo" in p).toBe(true);
expect("foo" in p).toBeFalse();
expect("foo" in p).toBeTrue();
});
});