import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import test from 'node:test' const runner = readFileSync(new URL('./phase4-test-frontend-acceptance.mjs', import.meta.url), 'utf8') const suite = readFileSync(new URL('./phase4-test-frontend.acceptance.ts', import.meta.url), 'utf8') test('test runner requires an explicit test environment and unified gateway', () => { assert.match(runner, /--environment/) assert.match(runner, /environment !== 'test'/) assert.match(runner, /--gateway/) assert.doesNotMatch(runner, /--overseas-gateway|VITE_OVERSEAS/) assert.match(runner, /shell: process\.platform === 'win32'/) assert.match(runner, /if \(result\.error\) throw result\.error/) assert.doesNotMatch(runner, /ADMIN_ACCEPTANCE_PASSWORD\s*[:=]\s*['"][^'"]+['"]/) }) test('live suite uses production auth clients and domain adapters', () => { assert.match(suite, /useAuthStore/) assert.match(suite, /refreshAuthenticatedSession/) assert.match(suite, /createQuote/) assert.match(suite, /createUsTruckOrder/) assert.match(suite, /createLocalLooseboardOrder/) assert.match(suite, /listLastMileOrders/) assert.match(suite, /listDispatchCandidates/) assert.match(suite, /listCarrierScheduleQueries/) }) test('live suite owns marker resources and redacts credentials from trace reports', () => { assert.match(suite, /ADMIN-FRONT-P4-/) assert.match(suite, /password\|token\|authorization/i) assert.match(suite, /createdResources/) assert.match(suite, /coverageGaps/) })