mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibJS: Add more test matchers
This commit is contained in:
parent
5e971c91e3
commit
fc08222f46
Notes:
sideshowbarker
2024-07-19 05:04:52 +09:00
Author: https://github.com/mattco98
Commit: fc08222f46
Pull-request: https://github.com/SerenityOS/serenity/pull/2689
Reviewed-by: https://github.com/linusg
8 changed files with 200 additions and 46 deletions
|
@ -1,8 +1,8 @@
|
|||
describe("[[Delete]] trap normal behavior", () => {
|
||||
test("forwarding when not defined in handler", () => {
|
||||
expect(delete (new Proxy({}, { deleteProperty: undefined })).foo).toBe(true);
|
||||
expect(delete (new Proxy({}, { deleteProperty: null })).foo).toBe(true);
|
||||
expect(delete (new Proxy({}, {})).foo).toBe(true);
|
||||
expect(delete (new Proxy({}, { deleteProperty: undefined })).foo).toBeTrue();
|
||||
expect(delete (new Proxy({}, { deleteProperty: null })).foo).toBeTrue();
|
||||
expect(delete (new Proxy({}, {})).foo).toBeTrue();
|
||||
});
|
||||
|
||||
test("correct arguments supplied to trap", () => {
|
||||
|
@ -30,8 +30,8 @@ describe("[[Delete]] trap normal behavior", () => {
|
|||
}
|
||||
});
|
||||
|
||||
expect(delete p.foo).toBe(true);
|
||||
expect(delete p.bar).toBe(false);
|
||||
expect(delete p.foo).toBeTrue();
|
||||
expect(delete p.bar).toBeFalse();
|
||||
|
||||
expect(o.foo).toBe(undefined);
|
||||
expect(o.bar).toBe(2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue