15 lines
633 B
JavaScript
15 lines
633 B
JavaScript
import { build } from 'esbuild'
|
|
import { spawnSync } from 'node:child_process'
|
|
|
|
const test = 'recommended-skills-backend-regression.ts'
|
|
const directory = '.tmp/recommended-skills-tests'
|
|
await build({
|
|
entryPoints: [`scripts/${test}`], outdir: directory, outExtension: { '.js': '.mjs' },
|
|
bundle: true, platform: 'node', format: 'esm', packages: 'external', logLevel: 'warning'
|
|
})
|
|
const result = spawnSync(process.execPath, [`${directory}/${test.replace(/\.tsx?$/, '.mjs')}`], {
|
|
stdio: 'inherit', windowsHide: true, timeout: 180000
|
|
})
|
|
if (result.error) throw result.error
|
|
if (result.status !== 0) process.exit(result.status ?? 1)
|