14 lines
979 B
JavaScript
14 lines
979 B
JavaScript
/** Offline React DOM only. Geometry is synthetic; this is not native scroll/pixel evidence. */
|
|
import { build } from 'esbuild'
|
|
import { spawnSync } from 'node:child_process'
|
|
import { createRequire } from 'node:module'
|
|
|
|
const domModule = process.env.YCODE_TEST_DOM_MODULE
|
|
if (!domModule) throw new Error('Set YCODE_TEST_DOM_MODULE to an installed jsdom module path. DOM coverage cannot be skipped.')
|
|
if (typeof createRequire(process.cwd() + '/package.json')(domModule).JSDOM !== 'function') throw new Error('DOM module must export JSDOM')
|
|
const outfile = '.tmp/alignment-tests/reasoning-follow-dom-regression.cjs'
|
|
await build({ entryPoints: ['scripts/reasoning-follow-dom-regression.tsx'], outfile, bundle: true, platform: 'node', format: 'cjs', jsx: 'automatic', loader: { '.css': 'empty' }, logLevel: 'warning' })
|
|
const result = spawnSync(process.execPath, [outfile], { stdio: 'inherit', timeout: 120000 })
|
|
if (result.error) throw result.error
|
|
process.exit(result.status ?? 1)
|