diff --git a/ts/smartexpect.classes.assertion.ts b/ts/smartexpect.classes.assertion.ts index e0a211e..9430831 100644 --- a/ts/smartexpect.classes.assertion.ts +++ b/ts/smartexpect.classes.assertion.ts @@ -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}`); + } + }); + } }