Skip to content

Commit cf69df7

Browse files
committedFeb 4, 2023
Remove dev-dependency
1 parent 6e359a4 commit cf69df7

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed
 

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"@types/tape": "^4.0.0",
5555
"c8": "^7.0.0",
5656
"cross-env": "^7.0.0",
57-
"figures": "^4.0.0",
5857
"prettier": "^2.0.0",
5958
"remark-cli": "^11.0.0",
6059
"remark-preset-wooorm": "^9.0.0",

‎test.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
/**
2-
* @typedef {import('vfile-message').VFileMessage} VFileMessage
3-
*/
4-
51
import path from 'node:path'
2+
import process from 'node:process'
63
import test from 'tape'
74
import strip from 'strip-ansi'
85
import {VFile} from 'vfile'
9-
import figures from 'figures'
106
import reporterDefault, {reporter} from './index.js'
117

8+
// `log-symbols` without chalk, ignored for Windows:
9+
/* c8 ignore next 4 */
10+
const chars =
11+
process.platform === 'win32'
12+
? {error: '×', warning: '‼'}
13+
: {error: '✖', warning: '⚠'}
14+
1215
/* eslint-disable no-undef */
1316
/** @type {Error} */
1417
let exception
@@ -104,7 +107,7 @@ test('vfile-reporter', (t) => {
104107
'',
105108
'b.js: no issues found',
106109
'',
107-
figures.warning + ' 1 warning'
110+
chars.warning + ' 1 warning'
108111
].join('\n'),
109112
'should work on files with warnings'
110113
)
@@ -123,7 +126,7 @@ test('vfile-reporter', (t) => {
123126
'',
124127
'b.js: no issues found',
125128
'',
126-
figures.cross + ' 1 error'
129+
chars.error + ' 1 error'
127130
].join('\n'),
128131
'should work on files with errors'
129132
)
@@ -155,9 +158,9 @@ test('vfile-reporter', (t) => {
155158
' 1:1 info Another note!',
156159
'',
157160
'6 messages (' +
158-
figures.cross +
161+
chars.error +
159162
' 2 errors, ' +
160-
figures.warning +
163+
chars.warning +
161164
' 3 warnings)'
162165
].join('\n'),
163166
'should work on files with multiple mixed messages'
@@ -175,9 +178,9 @@ test('vfile-reporter', (t) => {
175178
' 1:1 info Another note!',
176179
'',
177180
'6 messages (' +
178-
figures.cross +
181+
chars.error +
179182
' 2 errors, ' +
180-
figures.warning +
183+
chars.warning +
181184
' 3 warnings)'
182185
].join('\n'),
183186
'should work on files with multiple mixed messages (w/o color)'
@@ -188,7 +191,7 @@ test('vfile-reporter', (t) => {
188191

189192
t.equal(
190193
strip(reporter(file)),
191-
' warning Warning!\n\n' + figures.warning + ' 1 warning',
194+
' warning Warning!\n\n' + chars.warning + ' 1 warning',
192195
'should support a missing position'
193196
)
194197

@@ -197,7 +200,7 @@ test('vfile-reporter', (t) => {
197200

198201
t.equal(
199202
strip(reporter(file)),
200-
[' 3:2 warning Warning!', '', figures.warning + ' 1 warning'].join('\n'),
203+
[' 3:2 warning Warning!', '', chars.warning + ' 1 warning'].join('\n'),
201204
'should support a single point'
202205
)
203206

@@ -209,7 +212,7 @@ test('vfile-reporter', (t) => {
209212

210213
t.equal(
211214
strip(reporter(file)),
212-
[' 3:2-4:8 warning Warning!', '', figures.warning + ' 1 warning'].join(
215+
[' 3:2-4:8 warning Warning!', '', chars.warning + ' 1 warning'].join(
213216
'\n'
214217
),
215218
'should support a location'
@@ -228,7 +231,7 @@ test('vfile-reporter', (t) => {
228231
'foo.bar',
229232
' 3:2-4:8 warning Warning!',
230233
'',
231-
figures.warning + ' 1 warning'
234+
chars.warning + ' 1 warning'
232235
].join('\n'),
233236
'should support a location (#2)'
234237
)
@@ -326,7 +329,7 @@ test('vfile-reporter', (t) => {
326329
' 1:1 warning Whoops',
327330
'Lorem ipsum dolor sit amet.',
328331
'',
329-
figures.warning + ' 2 warnings'
332+
chars.warning + ' 2 warnings'
330333
].join('\n'),
331334
'should support `note` in verbose mode'
332335
)
@@ -336,12 +339,9 @@ test('vfile-reporter', (t) => {
336339

337340
t.equal(
338341
strip(reporter([file, new VFile({path: 'b.js'})], {quiet: true})),
339-
[
340-
'a.js',
341-
' 1:1 warning Warning!',
342-
'',
343-
figures.warning + ' 1 warning'
344-
].join('\n'),
342+
['a.js', ' 1:1 warning Warning!', '', chars.warning + ' 1 warning'].join(
343+
'\n'
344+
),
345345
'should ignore successful files in `quiet` mode'
346346
)
347347

@@ -356,7 +356,7 @@ test('vfile-reporter', (t) => {
356356

357357
t.equal(
358358
strip(reporter([file, fileB], {silent: true})),
359-
['a.js', ' 1:1 error Error!', '', figures.cross + ' 1 error'].join('\n'),
359+
['a.js', ' 1:1 error Error!', '', chars.error + ' 1 error'].join('\n'),
360360
'should ignore non-failures in `silent` mode'
361361
)
362362

0 commit comments

Comments
 (0)
Please sign in to comment.