File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
packages/@vue/cli-plugin-eslint/__tests__ Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -251,23 +251,21 @@ test(`should use formatter 'stylish'`, async () => {
251
251
252
252
const server = run ( 'vue-cli-service serve' )
253
253
254
- let isFirstMsg = true
254
+ let output = ''
255
255
server . stdout . on ( 'data' , data => {
256
- data = data . toString ( )
257
- if ( isFirstMsg ) {
258
- expect ( data ) . toMatch ( / F a i l e d t o c o m p i l e w i t h \d e r r o r / )
259
- isFirstMsg = false
260
- }
256
+ output += data . toString ( )
257
+ console . error ( 'output' , output )
261
258
262
- if ( data . match ( / s e m i / ) ) {
259
+ if ( / w e b p a c k c o m p i l e d w i t h 1 e r r o r / . test ( output ) ) {
260
+ expect ( output ) . toMatch ( / F a i l e d t o c o m p i l e w i t h \d e r r o r / )
263
261
// check the format of output
264
262
// https://eslint.org/docs/user-guide/formatters/#stylish
265
263
// it looks like:
266
264
// ERROR in .../packages/test/eslint-formatter-stylish/src/main.js
267
265
// 1:22 error Missing semicolon semi
268
- expect ( data ) . toMatch ( `src${ path . sep } main.js` )
269
- expect ( data ) . toMatch ( `error` )
270
- expect ( data ) . toMatch ( `Missing semicolon semi` )
266
+ expect ( output ) . toMatch ( `src${ path . sep } main.js` )
267
+ expect ( output ) . toMatch ( `error` )
268
+ expect ( output ) . toMatch ( `Missing semicolon semi` )
271
269
272
270
server . stdin . write ( 'close' )
273
271
done ( )
You can’t perform that action at this time.
0 commit comments