From e2baad9617f9d7972a50a9484335608cde447273 Mon Sep 17 00:00:00 2001 From: Matthew Thomas Date: Thu, 4 Jul 2024 18:11:50 +0100 Subject: [PATCH] fix: lint issue --- src/generate-report.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/generate-report.ts b/src/generate-report.ts index 8c7aa23..0c3256c 100644 --- a/src/generate-report.ts +++ b/src/generate-report.ts @@ -116,15 +116,19 @@ class GenerateCtrfReport extends WDIOReporter { } onRunnerEnd(runner: RunnerStats): void { - this.ctrfReport.results.summary.stop = Date.now() + this.ctrfReport.results.summary.stop = Date.now() const specFilePath = runner.specs[0] const pathParts = path.normalize(specFilePath).split(path.sep) const uniqueIdentifier = pathParts - .slice(-2) - .join('-') - .replace(/\.(js|ts)$/, '') - - const sanitizedUniqueIdentifier = uniqueIdentifier.replace(/[<>:"/\\|?*\x00-\x1F]/g, ''); + .slice(-2) + .join('-') + .replace(/\.(js|ts)$/, '') + + const sanitizedUniqueIdentifier = uniqueIdentifier.replace( + // eslint-disable-next-line no-control-regex + /[<>:"/\\|?*\x00-\x1F]/g, + '' + ) const timestamp = new Date().toISOString().replace(/[:.]/g, '-') this.reporterConfigOptions.outputFile = `ctrf-report-${sanitizedUniqueIdentifier}-${timestamp}.json` this.writeReportToFile(this.ctrfReport)