Files
NativeScript/apps/ui/e2e/helpers/image-helper.ts

15 lines
421 B
TypeScript

export const setImageName = (suite: string, spec: string, testsName: string) => {
let testName = testsName
.replace(suite, "")
.replace(spec, "");
testName = `${suite}-${spec}-${testName}`
.replace("should", "-")
.replace(/\s+/g, "-")
.replace(/\_+/ig, "_")
.replace(/[!$%^&*()+|~=`{}\[\]:";'<>?,.\/]/g, "")
.replace(/\-+/g, "-");
return testName;
};