1 | const colors = require("chalk");
|
2 | const terminal = require("window-size");
|
3 | const stripAnsi = require("strip-ansi");
|
4 |
|
5 |
|
6 | require("jest-chain");
|
7 | require("jest-extended");
|
8 |
|
9 | const MAIN_LINE = "⏤";
|
10 | const MAIN_ICON = "🚧";
|
11 | const DESCRIBE_ICON = "✏️";
|
12 | const TEST_ICON = "📝";
|
13 |
|
14 | module.exports = {
|
15 | icons: {
|
16 | MAIN_LINE,
|
17 | MAIN_ICON,
|
18 | DESCRIBE_ICON,
|
19 | TEST_ICON
|
20 | },
|
21 | classLabel: (str, icon = MAIN_ICON) => {
|
22 | let main = " " + str + " " + MAIN_LINE.repeat(terminal.width - str.length);
|
23 |
|
24 | return `\n${icon} ` + colors.magenta.bold(`${main}`);
|
25 | },
|
26 | commandLabel: (str, icon = TEST_ICON) => {
|
27 | return colors.cyan.bold(`\n ${icon} ${str}\n`);
|
28 | },
|
29 | testLabel: (str, icon = TEST_ICON) => {
|
30 | return colors.cyan.bold(`\n ${icon} ${str}\n`);
|
31 | },
|
32 | raw: str => {
|
33 | return JSON.stringify(str);
|
34 | },
|
35 | colors,
|
36 | terminal,
|
37 | stripAnsi
|
38 | };
|