fix(core): update

This commit is contained in:
Philipp Kunz 2022-01-21 19:40:30 +01:00
parent d3bdbf6260
commit 71cecfdc9a

View File

@ -100,4 +100,31 @@ export class Assertion {
}
});
}
public toBeTrue() {
return this.runCheck(() => {
const result = typeof this.baseReference === 'boolean' && this.baseReference === true;
if (!result) {
throw new Error(`${this.baseReference} is not true or not of type boolean`);
}
});
}
public toBeFalse() {
return this.runCheck(() => {
const result = typeof this.baseReference === 'boolean' && this.baseReference === false;
if (!result) {
throw new Error(`${this.baseReference} is not false or not of type boolean`);
}
});
}
public toBeInstanceOf(classArg: any) {
return this.runCheck(() => {
const result = this.baseReference instanceof classArg;
if (!result) {
throw new Error(`${this.baseReference} is not an instance of ${classArg}`);
}
});
}
}