import assert from 'node:assert/strict'; import { readFile } from 'node:fs/promises'; import test from 'node:test'; test( 'Playwright seeds editorial prerequisites once outside browser workers', async () => { const config = await readFile( 'playwright.config.mjs', 'utf8' ); const setup = await readFile( 'tests/e2e/global-setup.mjs', 'utf8' ); const spec = await readFile( 'tests/e2e/editorial-editor.spec.mjs', 'utf8' ); assert.match( config, /globalSetup:\s*['"]\.\/tests\/e2e\/global-setup\.mjs['"]/ ); assert.match( setup, /wp-env.*chrnx_seed_editorial_terms\(\);/s ); assert.equal( setup.match( /chrnx_seed_editorial_terms/g )?.length, 1 ); assert.doesNotMatch( spec, /wp-env|execFileSync|beforeAll/ ); } );