From eda3352f908998ab1173fbf88dabecc17c376a90 Mon Sep 17 00:00:00 2001 From: gnezim Date: Sat, 25 Apr 2026 02:27:11 +0300 Subject: [PATCH] e2e: fix console-gate ESM __dirname (use import.meta.url) --- tests/e2e/fixtures/console-gate.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/fixtures/console-gate.ts b/tests/e2e/fixtures/console-gate.ts index fb22c4e3..8c256515 100644 --- a/tests/e2e/fixtures/console-gate.ts +++ b/tests/e2e/fixtures/console-gate.ts @@ -1,6 +1,7 @@ import { test as base, expect } from "@playwright/test"; import fs from "node:fs"; import path from "node:path"; +import { fileURLToPath } from "node:url"; interface AllowlistEntry { pattern: string; @@ -11,7 +12,8 @@ interface Allowlist { patterns: AllowlistEntry[]; } -const ALLOWLIST_PATH = path.join(__dirname, "console-allowlist.json"); +const FIXTURE_DIR = path.dirname(fileURLToPath(import.meta.url)); +const ALLOWLIST_PATH = path.join(FIXTURE_DIR, "console-allowlist.json"); function loadAllowlist(): RegExp[] { const raw = fs.readFileSync(ALLOWLIST_PATH, "utf8");