Skip to content

Commit 23f8c6a

Browse files
committed
test: continue fixing the eslint test timeout…
1 parent 9eef877 commit 23f8c6a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,23 +251,21 @@ test(`should use formatter 'stylish'`, async () => {
251251

252252
const server = run('vue-cli-service serve')
253253

254-
let isFirstMsg = true
254+
let output = ''
255255
server.stdout.on('data', data => {
256-
data = data.toString()
257-
if (isFirstMsg) {
258-
expect(data).toMatch(/Failed to compile with \d error/)
259-
isFirstMsg = false
260-
}
256+
output += data.toString()
257+
console.error('output', output)
261258

262-
if (data.match(/semi/)) {
259+
if (/webpack compiled with 1 error/.test(output)) {
260+
expect(output).toMatch(/Failed to compile with \d error/)
263261
// check the format of output
264262
// https://eslint.org/docs/user-guide/formatters/#stylish
265263
// it looks like:
266264
// ERROR in .../packages/test/eslint-formatter-stylish/src/main.js
267265
// 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`)
271269

272270
server.stdin.write('close')
273271
done()

0 commit comments

Comments
 (0)