chore: change import assert to readFile (#368)

This commit is contained in:
Max Schmitt 2025-05-07 11:30:01 +02:00 committed by GitHub
parent 35e6c49d7c
commit 91ae93c167
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 6 deletions

View file

@ -15,6 +15,7 @@
*/
import fs from 'node:fs';
import url from 'node:url';
import os from 'node:os';
import path from 'node:path';
@ -381,3 +382,6 @@ async function createUserDataDir(browserConfig: Config['browser']) {
export async function generateLocator(locator: playwright.Locator): Promise<string> {
return (locator as any)._generateLocatorString();
}
const __filename = url.fileURLToPath(import.meta.url);
export const packageJSON = JSON.parse(fs.readFileSync(path.join(path.dirname(__filename), '..', 'package.json'), 'utf8'));