1 | #!/usr/bin/env node
|
2 |
|
3 |
|
4 | const { spawnSync } = require("child_process");
|
5 | const colors = require("chalk");
|
6 |
|
7 | let iterations = process.argv.slice(2)[0] || 5;
|
8 |
|
9 | console.log("");
|
10 | console.time(colors.red("Execution Time"));
|
11 | for (let idx = 1; idx <= iterations; idx++) {
|
12 | let pct = Math.round((idx / iterations) * 100);
|
13 | let msg = `${colors.blue.bold("==> Running Stress Test:")} ${idx} of ${iterations} (${pct}%)`;
|
14 | console.log(colors.green(msg));
|
15 | spawnSync("yarn", ["run", "test"], { stdio: "inherit" });
|
16 | }
|
17 | console.timeEnd(colors.red("Execution Time"));
|