2026-10-12 14:40:37 +03:30
|
|
|
import { spawnSync } from 'node:child_process'
|
|
|
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
|
import { dirname, join } from 'node:path'
|
|
|
|
|
|
|
|
|
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
|
|
|
const root = join(here, '..')
|
|
|
|
|
process.env.TSX_TSCONFIG_PATH = join(root, 'tsconfig.test.json')
|
|
|
|
|
|
|
|
|
|
const files = [
|
|
|
|
|
'session-sync.test.ts',
|
|
|
|
|
'catalog-api.test.ts',
|
|
|
|
|
'mutation-queue.test.ts',
|
|
|
|
|
'gold-guess-rewards.test.ts',
|
2026-10-22 19:42:04 +03:30
|
|
|
'budgeting-mission.test.ts',
|
|
|
|
|
'risk-return.test.ts',
|
|
|
|
|
'portfolio.test.ts',
|
|
|
|
|
'compound-interest.test.ts',
|
|
|
|
|
'smart-shop.test.ts',
|
|
|
|
|
'financial-goal.test.ts',
|
|
|
|
|
'castle-exam.test.ts',
|
2026-10-12 14:40:37 +03:30
|
|
|
]
|
|
|
|
|
let failed = false
|
|
|
|
|
|
|
|
|
|
for (const file of files) {
|
|
|
|
|
const result = spawnSync(
|
|
|
|
|
process.execPath,
|
|
|
|
|
['--import', 'tsx', '--test', '--test-reporter=spec', join(here, file)],
|
|
|
|
|
{ cwd: root, stdio: 'inherit', env: process.env },
|
|
|
|
|
)
|
|
|
|
|
if (result.status !== 0) failed = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
process.exit(failed ? 1 : 0)
|