This commit is contained in:
Louis Lam
2024-10-26 19:18:40 +08:00
parent 5dce44277f
commit 16225acdbd
2 changed files with 15 additions and 1 deletions

12
extra/test-backend.mjs Normal file
View File

@@ -0,0 +1,12 @@
// If Node.js >= 22, run `npm run test-backend-node22`, otherwise run `npm run test-backend-node20`
import * as childProcess from "child_process";
const version = parseInt(process.version.slice(1));
console.log(`Node.js version: ${version}`);
if (version >= 22) {
childProcess.execSync("npm run test-backend-node22", { stdio: "inherit" });
} else {
childProcess.execSync("npm run test-backend-node20", { stdio: "inherit" });
}