fix(core): update

This commit is contained in:
2022-02-02 02:45:45 +01:00
parent 3bd650dc2c
commit 9e92b8cff4
4 changed files with 327 additions and 114 deletions

View File

@ -127,4 +127,31 @@ export class Assertion {
}
});
}
public toHaveProperty(propertyArg: string) {
return this.runCheck(() => {
const result = !!this.baseReference[propertyArg];
if (!result) {
throw new Error(`${this.baseReference} does not have property ${propertyArg}`);
}
});
}
public toBeGreaterThan(numberArg: number) {
return this.runCheck(() => {
const result = this.baseReference > numberArg;
if (!result) {
throw new Error(`${this.baseReference} is not greater than ${numberArg}`);
}
});
}
public toBeLessThan(numberArg: number) {
return this.runCheck(() => {
const result = this.baseReference < numberArg;
if (!result) {
throw new Error(`${this.baseReference} is not less than ${numberArg}`);
}
});
}
}