Files
engine/tests/index.ts
AZhan 7f76e9c92c Adds protection for value infinity in BoundingBox (#1892)
* fix: bounding box adds protection for value infinity
2023-12-04 14:48:48 +08:00

24 lines
593 B
TypeScript

import fs from "fs";
import path from "path";
const { IS_COV } = process.env;
function searchTests(root: string) {
fs.readdirSync(root).forEach((file) => {
const filePath = path.join(root, file);
const stat = fs.statSync(filePath);
if (stat.isFile() && filePath.endsWith(".test.ts")) {
if (IS_COV && path.basename(filePath) === "KTX2Loader.test.ts") {
return;
}
describe(file, function () {
require(filePath);
});
} else if (stat.isDirectory()) {
searchTests(filePath);
}
});
}
searchTests(path.join(__dirname, "src"));