OneAlign / web /scripts /test.mjs
loveaa's picture
Home Pulse 1.2: app interface, recommended event policies and independent location reminders
133b124 verified
Raw History Blame Contribute Delete
840 Bytes
import { build } from 'esbuild'
import { spawnSync } from 'node:child_process'
import fs from 'node:fs'
fs.mkdirSync('.local/tests',{recursive:true})
for (const [input,name] of [['src/lib/domain.ts','domain'],['src/lib/engine.ts','engine'],['tests/render-entry.tsx','render']]) {
await build({entryPoints:[input],outfile:'.local/tests/'+name+'.mjs',bundle:true,platform:'node',format:'esm',packages:'external',jsx:'automatic',logLevel:'silent'})
}
const result=spawnSync(process.execPath,['--test','--test-concurrency=1','tests/domain.test.mjs','tests/metrics.test.mjs','tests/server.test.mjs','tests/render.test.mjs','tests/contract.test.mjs','tests/plan-checks.test.mjs','tests/grounded.test.mjs','tests/cloud.test.mjs','tests/app-api.test.mjs','tests/observation-policy.test.mjs'],{stdio:'inherit'})
process.exitCode=result.status||0