mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-06 15:08:27 -06:00
* test: add cypress test for TS * fix: remove webpack-preprocessor from cypress config Removes the `@cypress/webpack-preprocessor` from the generated cypress configuration, as it leads to several issues regarding file watching, headless mode and TS support. Fixes #2903
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
jest.setTimeout(process.env.APPVEYOR ? 120000 : 60000)
|
|
|
|
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': {},
|
|
'@vue/cli-plugin-eslint': {
|
|
config: 'airbnb',
|
|
lintOn: 'save'
|
|
}
|
|
}
|
|
})
|
|
|
|
const config = JSON.parse(await project.read('cypress.json'))
|
|
config.video = false
|
|
await project.write('cypress.json', JSON.stringify(config))
|
|
|
|
if (!process.env.CI) {
|
|
await project.run(`vue-cli-service test:e2e`)
|
|
} else if (!process.env.APPVEYOR) {
|
|
await project.run(`vue-cli-service test:e2e --headless`)
|
|
}
|
|
})
|
|
|
|
test('should work with TS', async () => {
|
|
const project = await create('e2e-cypress-ts', {
|
|
plugins: {
|
|
'@vue/cli-plugin-typescript': {
|
|
'classComponent': true,
|
|
'tsLint': true,
|
|
'lintOn': ['save']
|
|
},
|
|
'@vue/cli-plugin-e2e-cypress': {}
|
|
}
|
|
})
|
|
|
|
const config = JSON.parse(await project.read('cypress.json'))
|
|
config.video = false
|
|
await project.write('cypress.json', JSON.stringify(config))
|
|
|
|
if (!process.env.CI) {
|
|
await project.run(`vue-cli-service test:e2e`)
|
|
} else if (!process.env.APPVEYOR) {
|
|
await project.run(`vue-cli-service test:e2e --headless`)
|
|
}
|
|
})
|