Files
arbpulse_github/scripts/run-tests.mjs
T
Mauricio Barragan 2e8744ccf0 Initial commit: Arb Pulse monolith with CI and optional Fly deploy.
Real-time BTC cross-exchange arbitrage detection (Kraken, Bybit, OKX, Binance)
with React dashboard, GitHub Actions CI, and documented Fly.io deploy workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 21:04:53 -06:00

33 lines
784 B
JavaScript

import { spawnSync } from "node:child_process";
import { readdirSync, statSync } from "node:fs";
import { join } from "node:path";
/** @param {string} dir */
function collectTestFiles(dir) {
/** @type {string[]} */
const files = [];
for (const name of readdirSync(dir)) {
const path = join(dir, name);
if (statSync(path).isDirectory()) {
files.push(...collectTestFiles(path));
} else if (name.endsWith(".test.ts")) {
files.push(path);
}
}
return files;
}
const files = collectTestFiles("src");
if (files.length === 0) {
console.error("No test files found under src/");
process.exit(1);
}
const result = spawnSync(
process.execPath,
["--import", "tsx", "--test", ...files],
{ stdio: "inherit" },
);
process.exit(result.status ?? 1);