Files
NativeScript/apps/ui/e2e/helpers/image-helper.ts
Nathan Walker 1e6fccf272 chore: cleanup
2020-07-23 14:03:37 -07:00

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