Skip to content

Commit

Permalink
fix esm import error
Browse files Browse the repository at this point in the history
  • Loading branch information
gti committed Apr 8, 2024
1 parent 93f92d7 commit 3c06c6f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/functional/esm-utils/window-helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import config from '../config';
import config from '../config.js';
import { ClientFunction } from 'testcafe';
import { writeFile, mkdir } from 'fs/promises';
import { dirname } from 'path';
Expand Down Expand Up @@ -30,13 +30,13 @@ const getWindowWidth = ClientFunction(() => window.innerWidth);
const getWindowHeight = ClientFunction(() => window.innerHeight);
const getWindowDevicePixelRatio = ClientFunction(() => window.devicePixelRatio);

const writeScreenshotMeta = async () => {
const devicePixelRatio = await getWindowDevicePixelRatio();
const metaData = { devicePixelRatio };
async function writeScreenshotMeta () {
const devicePixelRatio = await getWindowDevicePixelRatio();
const metaData = { devicePixelRatio };

await mkdir(dirname(config.testScreenshotsMetaFile), { recursive: true });
await writeFile(config.testScreenshotsMetaFile, JSON.stringify(metaData));
};
}

export {
saveWindowState,
Expand Down

0 comments on commit 3c06c6f

Please sign in to comment.