fix(core): update
This commit is contained in:
parent
6fdd61b230
commit
b5d2be3ab8
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user