mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-20 22:30:05 -06:00
test lint on save
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
jest.setTimeout(10000)
|
||||
jest.setTimeout(60000)
|
||||
|
||||
const path = require('path')
|
||||
const create = require('@vue/cli-test-utils/createTestProject')
|
||||
// const serve = require('@vue/cli-test-utils/serveWithPuppeteer')
|
||||
const serve = require('@vue/cli-test-utils/serveWithPuppeteer')
|
||||
|
||||
const runSilently = fn => {
|
||||
const log = console.log
|
||||
@@ -48,5 +48,15 @@ test('should work', async () => {
|
||||
// should be linted on commit
|
||||
expect(await read('src/main.js')).toMatch(';')
|
||||
|
||||
// TODO lint-on-save
|
||||
// lint-on-save
|
||||
write('vue.config.js', 'module.exports = { lintOnSave: true }')
|
||||
await serve(project, async ({ nextUpdate }) => {
|
||||
// linted when starting up the server by eslint-loader
|
||||
expect(await read('src/main.js')).toMatch(';')
|
||||
write('src/main.js', updatedMain)
|
||||
await nextUpdate()
|
||||
await new Promise(r => setTimeout(r, 1000))
|
||||
// should be linted again on save
|
||||
expect(await read('src/main.js')).toMatch(';')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
jest.setTimeout(process.env.CI ? 60000 : 20000)
|
||||
jest.setTimeout(30000)
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
jest.setTimeout(process.env.CI ? 30000 : 10000)
|
||||
jest.setTimeout(30000)
|
||||
|
||||
const { defaults } = require('@vue/cli/lib/options')
|
||||
const create = require('@vue/cli-test-utils/createTestProject')
|
||||
|
||||
Reference in New Issue
Block a user