Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
af12f068aa | |||
b5d2be3ab8 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartexpect",
|
"name": "@pushrocks/smartexpect",
|
||||||
"version": "1.0.12",
|
"version": "1.0.13",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartexpect",
|
"name": "@pushrocks/smartexpect",
|
||||||
"version": "1.0.12",
|
"version": "1.0.13",
|
||||||
"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.12",
|
"version": "1.0.13",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "manage expectations in code",
|
"description": "manage expectations in code",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -205,6 +205,30 @@ export class Assertion {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public toStartWith(itemArg: any) {
|
||||||
|
return this.runCheck(() => {
|
||||||
|
const testObject = this.getObjectToTestReference();
|
||||||
|
const result =
|
||||||
|
typeof testObject === 'string' &&
|
||||||
|
testObject.startsWith(itemArg);
|
||||||
|
if (!result) {
|
||||||
|
throw new Error(`${this.baseReference} with drill down ${this.propertyDrillDown} is not contain ${itemArg}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public toEndWith(itemArg: any) {
|
||||||
|
return this.runCheck(() => {
|
||||||
|
const testObject = this.getObjectToTestReference();
|
||||||
|
const result =
|
||||||
|
typeof testObject === 'string' &&
|
||||||
|
testObject.endsWith(itemArg);
|
||||||
|
if (!result) {
|
||||||
|
throw new Error(`${this.baseReference} with drill down ${this.propertyDrillDown} is not contain ${itemArg}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public property(propertyNameArg: string) {
|
public property(propertyNameArg: string) {
|
||||||
this.propertyDrillDown.push(propertyNameArg);
|
this.propertyDrillDown.push(propertyNameArg);
|
||||||
return this;
|
return this;
|
||||||
|
Reference in New Issue
Block a user