mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-24 16:18:57 -06:00
test: continue fixing the eslint test timeout…
This commit is contained in:
@@ -251,23 +251,21 @@ test(`should use formatter 'stylish'`, async () => {
|
||||
|
||||
const server = run('vue-cli-service serve')
|
||||
|
||||
let isFirstMsg = true
|
||||
let output = ''
|
||||
server.stdout.on('data', data => {
|
||||
data = data.toString()
|
||||
if (isFirstMsg) {
|
||||
expect(data).toMatch(/Failed to compile with \d error/)
|
||||
isFirstMsg = false
|
||||
}
|
||||
output += data.toString()
|
||||
console.error('output', output)
|
||||
|
||||
if (data.match(/semi/)) {
|
||||
if (/webpack compiled with 1 error/.test(output)) {
|
||||
expect(output).toMatch(/Failed to compile with \d error/)
|
||||
// check the format of output
|
||||
// https://eslint.org/docs/user-guide/formatters/#stylish
|
||||
// it looks like:
|
||||
// ERROR in .../packages/test/eslint-formatter-stylish/src/main.js
|
||||
// 1:22 error Missing semicolon semi
|
||||
expect(data).toMatch(`src${path.sep}main.js`)
|
||||
expect(data).toMatch(`error`)
|
||||
expect(data).toMatch(`Missing semicolon semi`)
|
||||
expect(output).toMatch(`src${path.sep}main.js`)
|
||||
expect(output).toMatch(`error`)
|
||||
expect(output).toMatch(`Missing semicolon semi`)
|
||||
|
||||
server.stdin.write('close')
|
||||
done()
|
||||
|
||||
Reference in New Issue
Block a user