fix(core): update

This commit is contained in:
Philipp Kunz 2022-03-14 13:07:46 +01:00
parent 6fdd61b230
commit b5d2be3ab8

View File

@ -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;