UNPKG

962 BJavaScriptView Raw
1const colors = require("chalk");
2const terminal = require("window-size");
3const stripAnsi = require("strip-ansi");
4
5// require some additional matchers and chaining
6require("jest-chain");
7require("jest-extended");
8
9const MAIN_LINE = "⏤";
10const MAIN_ICON = "🚧";
11const DESCRIBE_ICON = "✏️";
12const TEST_ICON = "📝";
13
14module.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 // return colors.magenta.bold(`\n${icon} ${main}`);
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};