Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
3bd650dc2c | |||
71cecfdc9a |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartexpect",
|
"name": "@pushrocks/smartexpect",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartexpect",
|
"name": "@pushrocks/smartexpect",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^2.0.13",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartexpect",
|
"name": "@pushrocks/smartexpect",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "manage expectations in code",
|
"description": "manage expectations in code",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -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}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user