diff --git a/package.json b/package.json index b99fe1fef..2903e3ce0 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "docs:map-generator": "cd map-generator && go doc -cmd -u -all", "tunnel": "npm run build-prod && npm run start:server", "test": "vitest run && vitest run tests/server", - "perf": "npx tsx tests/perf/*.ts", + "perf": "npx tsx tests/perf/run-all.ts", "test:coverage": "vitest run --coverage", "format": "prettier --ignore-unknown --write .", "format:map-generator": "cd map-generator && go fmt .", diff --git a/tests/perf/run-all.ts b/tests/perf/run-all.ts new file mode 100644 index 000000000..be84c1971 --- /dev/null +++ b/tests/perf/run-all.ts @@ -0,0 +1,9 @@ +import { execSync } from "child_process"; +import { globSync } from "glob"; + +// "perf": "npx tsx tests/perf/*.ts" doesn't work on Windows +const files = globSync("tests/perf/*.ts").filter((f) => !f.includes("run-all")); +for (const file of files) { + console.log(`\nRunning ${file}...`); + execSync(`tsx "${file}"`, { stdio: "inherit" }); +}