Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function fileArrToString(fileArr: string[]): string {
return fileArr.map(val => path.basename(val).replace(".spec.js", "")).join(", ");
}
function printTestStats(testCount: number, failedTestCount: number, header: string, footer: string): void {
console.log("-----------------");
console.log(header);
console.log(`Total: ${testCount}`);
console.log(`Passed: ${testCount - failedTestCount}`);
console.log(`Failed: ${failedTestCount}`);
console.log(footer);
console.log("-----------------");
}
config.set({
basepath: {
node: __dirname,
}
});
let cpuCount = os.cpus().length + 1;
if ("TRAVIS" in process.env && "CI" in process.env) {
// fixed thread count for CI
cpuCount = 8;
}
const testFiles: string[] = glob.sync("./test/**/*.spec.js");
const pool = new Pool(cpuCount);
let jobCounter = 0;
const testStartTime = new Date();
const fileCount = testFiles.length;
let exitWithError = false;