Uptime calculation improvement and 1-year uptime (#2750)

This commit is contained in:
Louis Lam
2023-09-01 05:19:21 +08:00
committed by GitHub
parent eec221247f
commit 076331bf00
22 changed files with 1306 additions and 264 deletions

View File

@@ -0,0 +1,20 @@
// Check Node.js version
const semver = require("semver");
const childProcess = require("child_process");
const nodeVersion = process.versions.node;
console.log("Node.js version: " + nodeVersion);
// Node.js version >= 18
if (semver.satisfies(nodeVersion, ">= 18")) {
console.log("Use the native test runner: `node --test`");
childProcess.execSync("npm run test-backend:18", { stdio: "inherit" });
} else {
// 14 - 16 here
console.log("Use `test` package: `node--test`")
childProcess.execSync("npm run test-backend:14", { stdio: "inherit" });
}