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",
|
||||
"version": "1.0.12",
|
||||
"version": "1.0.13",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartexpect",
|
||||
"version": "1.0.12",
|
||||
"version": "1.0.13",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartexpect",
|
||||
"version": "1.0.12",
|
||||
"version": "1.0.13",
|
||||
"private": false,
|
||||
"description": "manage expectations in code",
|
||||
"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) {
|
||||
this.propertyDrillDown.push(propertyNameArg);
|
||||
return this;
|
||||
|
Reference in New Issue
Block a user