|
1 | 1 | import test from 'ava';
|
2 |
| -import hasAnsi from 'has-ansi'; |
3 | 2 | import chalk from 'chalk';
|
4 |
| -import {yellow, red, magenta, blue} from 'ansi-styles'; |
5 | 3 | import {includes} from 'lodash';
|
6 | 4 | import format from './format';
|
7 | 5 |
|
@@ -49,19 +47,6 @@ test('returns a correct of empty .errors and .warnings', t => {
|
49 | 47 | t.true(includes(msg, '1 problems, 1 warnings'));
|
50 | 48 | });
|
51 | 49 |
|
52 |
| -test('colors messages by default', t => { |
53 |
| - const [msg] = format({ |
54 |
| - errors: [], |
55 |
| - warnings: [] |
56 |
| - }); |
57 |
| - t.true(hasAnsi(msg)); |
58 |
| -}); |
59 |
| - |
60 |
| -test('does not color messages if configured', t => { |
61 |
| - const [msg] = format({}, {color: false}); |
62 |
| - t.false(hasAnsi(msg)); |
63 |
| -}); |
64 |
| - |
65 | 50 | test('uses appropriate signs by default', t => {
|
66 | 51 | const [err, warn] = format({
|
67 | 52 | errors: [
|
@@ -110,54 +95,3 @@ test('uses signs as configured', t => {
|
110 | 95 | t.true(includes(err, 'ERR'));
|
111 | 96 | t.true(includes(warn, 'WRN'));
|
112 | 97 | });
|
113 |
| - |
114 |
| -test('uses appropriate colors by default', t => { |
115 |
| - const [err, warn] = format({ |
116 |
| - errors: [ |
117 |
| - { |
118 |
| - level: 2, |
119 |
| - name: 'error-name', |
120 |
| - message: 'There was an error' |
121 |
| - } |
122 |
| - ], |
123 |
| - warnings: [ |
124 |
| - { |
125 |
| - level: 1, |
126 |
| - name: 'warning-name', |
127 |
| - message: 'There was a problem' |
128 |
| - } |
129 |
| - ] |
130 |
| - }); |
131 |
| - |
132 |
| - t.true(includes(err, red.open)); |
133 |
| - t.true(includes(warn, yellow.open)); |
134 |
| -}); |
135 |
| - |
136 |
| -if (process.platform !== 'win32') { |
137 |
| - test('uses colors as configured', t => { |
138 |
| - const [err, warn] = format( |
139 |
| - { |
140 |
| - errors: [ |
141 |
| - { |
142 |
| - level: 2, |
143 |
| - name: 'error-name', |
144 |
| - message: 'There was an error' |
145 |
| - } |
146 |
| - ], |
147 |
| - warnings: [ |
148 |
| - { |
149 |
| - level: 1, |
150 |
| - name: 'warning-name', |
151 |
| - message: 'There was a problem' |
152 |
| - } |
153 |
| - ] |
154 |
| - }, |
155 |
| - { |
156 |
| - colors: ['white', 'magenta', 'blue'] |
157 |
| - } |
158 |
| - ); |
159 |
| - |
160 |
| - t.true(includes(err, blue.open)); |
161 |
| - t.true(includes(warn, magenta.open)); |
162 |
| - }); |
163 |
| -} |
0 commit comments