mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-05-02 18:09:38 -05:00
test: tests for e2e plugins
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rules": {
|
||||
"vue-libs/no-async-functions": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
jest.setTimeout(30000)
|
||||
|
||||
const create = require('@vue/cli-test-utils/createTestProject')
|
||||
|
||||
test('should work', async () => {
|
||||
const project = await create('e2e-cypress', {
|
||||
plugins: {
|
||||
'@vue/cli-plugin-babel': {},
|
||||
'@vue/cli-plugin-e2e-cypress': {}
|
||||
}
|
||||
})
|
||||
|
||||
const config = JSON.parse(await project.read('cypress.json'))
|
||||
config.videoRecording = false
|
||||
await project.write('cypress.json', JSON.stringify(config))
|
||||
|
||||
await project.run(`vue-cli-service e2e`)
|
||||
})
|
||||
@@ -28,6 +28,13 @@ module.exports = (api, options) => {
|
||||
runner.on('exit', () => server.close())
|
||||
runner.on('error', () => server.close())
|
||||
}
|
||||
|
||||
if (process.env.VUE_CLI_TEST) {
|
||||
runner.on('exit', code => {
|
||||
process.exit(code)
|
||||
})
|
||||
}
|
||||
|
||||
return runner
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rules": {
|
||||
"vue-libs/no-async-functions": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
jest.setTimeout(20000)
|
||||
|
||||
const create = require('@vue/cli-test-utils/createTestProject')
|
||||
|
||||
test('should work', async () => {
|
||||
const project = await create('e2e-nightwatch', {
|
||||
plugins: {
|
||||
'@vue/cli-plugin-babel': {},
|
||||
'@vue/cli-plugin-e2e-nightwatch': {}
|
||||
}
|
||||
})
|
||||
await project.run(`vue-cli-service e2e`)
|
||||
})
|
||||
@@ -39,6 +39,13 @@ module.exports = (api, options) => {
|
||||
runner.on('exit', () => server.close())
|
||||
runner.on('error', () => server.close())
|
||||
}
|
||||
|
||||
if (process.env.VUE_CLI_TEST) {
|
||||
runner.on('exit', code => {
|
||||
process.exit(code)
|
||||
})
|
||||
}
|
||||
|
||||
return runner
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user