diff --git a/src/utils/test/getScreenshotFileNames.ts b/src/utils/test/getScreenshotFileNames.ts index cea121a5..d9886d63 100644 --- a/src/utils/test/getScreenshotFileNames.ts +++ b/src/utils/test/getScreenshotFileNames.ts @@ -23,7 +23,7 @@ export const getScreenshotFileNames = async ( const directoryPath = join(SCREENSHOTS_DIRECTORY_PATH, directoryName); const alreadyExistingScreenshots = await readdir(directoryPath).catch((): string[] => []); - const fileNamePrefix = `${testStaticOptions.name}.`.replace(/"/g, ''); + const fileNamePrefix = `${testStaticOptions.name}.`.replace(/[^a-zA-Z0-9\-._~]/g, '_'); const currentFullPageScreenshotsIndex = Math.max( 0,