// UI acceptance runs serially on the same origin as the released application. // Never attach a test to a listener owned by another process. import net from 'node:net'; export const UI_URL = 'http://127.0.0.1:8787'; export async function assertUiPortAvailable() { await new Promise((resolve, reject) => { const probe = net.createServer(); probe.once('error', () => reject(new Error('8787 occupied; stop the project safely before running UI acceptance. No existing service was changed.'))); probe.listen(8787, '127.0.0.1', () => probe.close(resolve)); }); }