From 22fea1598c503312e833260f8acccf9d1daacea2 Mon Sep 17 00:00:00 2001 From: "ala'n (Alexey Stsefanovich)" Date: Thu, 15 Feb 2024 15:41:03 +0100 Subject: [PATCH] style(e2e): apply suggestions from code review Co-authored-by: Yuliya Adamska <48826082+yadamskaya@users.noreply.github.com> --- e2e/reporters/printers.js | 2 +- e2e/reporters/reporter.js | 2 +- e2e/setup/scenarios.screenshot.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/reporters/printers.js b/e2e/reporters/printers.js index d38f79fd6..3bd132962 100644 --- a/e2e/reporters/printers.js +++ b/e2e/reporters/printers.js @@ -18,7 +18,7 @@ const printSummary = (stats) => { const resolveURL = (basePath, snapshot) => { if (!basePath) return snapshot; let path = basePath + (basePath.endsWith('/') ? '' : '/') + snapshot; - if (basePath.includes('github')) path+= '?raw=true'; + if (basePath.includes('github')) path += '?raw=true'; return path.replace(/\\/g, '/'); }; diff --git a/e2e/reporters/reporter.js b/e2e/reporters/reporter.js index d71a5d2d5..750f2f7c3 100644 --- a/e2e/reporters/reporter.js +++ b/e2e/reporters/reporter.js @@ -52,7 +52,7 @@ class SnapshotAwareReporter { if (status === 'passed') return statBase; const snapshotParts = [filename, ...ancestorTitles, title, '1-snap', 'diff']; - const snapshotName = snapshotParts.map(sanitize).join('-') + '.png' + const snapshotName = snapshotParts.map(sanitize).join('-') + '.png'; const snapshotPath = path.join(this._options.diffDir, snapshotName); const snapshotExists = fs.existsSync(snapshotPath); diff --git a/e2e/setup/scenarios.screenshot.ts b/e2e/setup/scenarios.screenshot.ts index e64314827..931325f31 100644 --- a/e2e/setup/scenarios.screenshot.ts +++ b/e2e/setup/scenarios.screenshot.ts @@ -3,7 +3,7 @@ import type {TestEnv} from './scenarious.world'; import type {MatchImageSnapshotOptions} from 'jest-image-snapshot'; const DIFF_CONFIG: MatchImageSnapshotOptions = { - customDiffDir: '.diff', + customDiffDir: '.diff' }; cucumber.defineRule('take a screenshot', async (world: TestEnv) => {