-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
39 lines (35 loc) · 1014 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { raw } from "../reporters/raw";
import { dots } from "../reporters/dots";
import { runner } from "./runner";
import { bundleAllTests } from "./bundleAllTests";
import { Config } from "./types";
const args = process.argv;
const watch = args.includes("--watch") || args.includes("-w");
const anybar = watch || args.includes("--anybar");
const verbose = args.includes("--verbose");
const bundle = args.includes("--bundle");
const coverage = watch || args.includes("--coverage");
const config: Config = {
cwd: process.cwd(),
paths: ["src", "tests"],
tests: ["*.test.ts", "*.test.tsx", "*.test.js", "*.test.jsx"],
ignored: [],
reporters: ["text", "html"],
watch,
coverage,
tmpDir: "./node_modules/.verdant_tmp",
coverageReportDir: "./reports/coverage",
bundlePath: "./build/test.cjs",
};
function main() {
if (bundle) {
bundleAllTests(config);
return;
}
if (verbose) {
runner(config, raw());
} else {
runner(config, dots({ clear: watch, anybar }));
}
}
main();