File tree 1 file changed +6
-4
lines changed
packages/@vue/cli-plugin-eslint/__tests__ 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -72,15 +72,17 @@ test('should work', async () => {
72
72
let isFirstMsg = true
73
73
server . stdout . on ( 'data' , data => {
74
74
data = data . toString ( )
75
- if ( data . match ( / C o m p i l e d w i t h \d w a r n i n g / ) ) {
75
+ if ( isFirstMsg ) {
76
76
// should fail on start
77
- expect ( isFirstMsg ) . toBe ( true )
77
+ expect ( data ) . toMatch ( / C o m p i l e d w i t h \d w a r n i n g / )
78
78
isFirstMsg = false
79
+
79
80
// fix it
80
81
write ( 'src/App.vue' , app )
81
82
} else if ( data . match ( / C o m p i l e d s u c c e s s f u l l y / ) ) {
82
- // should compile on 2nd update
83
- expect ( isFirstMsg ) . toBe ( false )
83
+ // should compile on the subsequent update
84
+ // (note: in CI environment this may not be the exact 2nd update,
85
+ // so we use data.match as a termination condition rather than a test case)
84
86
server . stdin . write ( 'close' )
85
87
done ( )
86
88
}
You can’t perform that action at this time.
0 commit comments