test: tests for e2e plugins

This commit is contained in:
Evan You
2018-01-24 23:08:20 -05:00
parent 5fef42cbd6
commit 20973c8413
6 changed files with 55 additions and 0 deletions
@@ -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
})
})