fix(core): update
This commit is contained in:
@ -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}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user