UNPKG

578 BJavaScriptView Raw
1#!/usr/bin/env node
2/*eslint no-console: "off"*/
3
4const { spawnSync } = require("child_process");
5const colors = require("chalk");
6
7let iterations = process.argv.slice(2)[0] || 5;
8
9console.log("");
10console.time(colors.red("Execution Time"));
11for (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}
17console.timeEnd(colors.red("Execution Time"));