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

LibJS: Add the Set built-in object

This commit is contained in:
Idan Horowitz 2021-06-09 00:08:47 +03:00 committed by Linus Groh
parent b17a282b4b
commit 670be04c81
15 changed files with 359 additions and 30 deletions

View file

@ -97,6 +97,17 @@ class ExpectationError extends Error {
});
}
toHaveSize(size) {
this.__expect(
typeof this.target.size === "number",
() => "toHaveSize: target.size not of type number"
);
this.__doMatcher(() => {
this.__expect(Object.is(this.target.size, size));
});
}
toHaveProperty(property, value) {
this.__doMatcher(() => {
let object = this.target;