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