Files
engine/tests/index.ts
yangfengzzz ba9d1b00fe material and texture unit tests (#892)
* test: texture and material unit tests
2022-07-27 11:49:08 +08:00

19 lines
458 B
TypeScript

import fs from "fs";
import path from "path";
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")) {
require(filePath);
} else if (stat.isDirectory()) {
describe(file, () => {
searchTests(filePath);
});
}
});
}
searchTests(path.join(__dirname, "src"));