Skip to content

fix: remove webpack-preprocessor from cypress config #2904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,28 @@ test('should work', async () => {
}
})

const pkg = JSON.parse(await project.read('package.json'))
expect(pkg.devDependencies).toHaveProperty('@cypress/webpack-preprocessor')
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
Expand Down
3 changes: 0 additions & 3 deletions packages/@vue/cli-plugin-e2e-cypress/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ module.exports = api => {
})

api.extendPackage({
devDependencies: {
'@cypress/webpack-preprocessor': '^3.0.0'
},
scripts: {
'test:e2e': 'vue-cli-service test:e2e'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// https://docs.cypress.io/guides/guides/plugins-guide.html
/* eslint-disable import/no-extraneous-dependencies, global-require */
const webpack = require('@cypress/webpack-preprocessor')

// if you need a custom webpack configuration you can uncomment the following import
// and then use the `file:preprocessor` event
// as explained in the cypress docs
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples

// /* eslint-disable import/no-extraneous-dependencies, global-require */
// const webpack = require('@cypress/webpack-preprocessor')

module.exports = (on, config) => {
on('file:preprocessor', webpack({
webpackOptions: require('@vue/cli-service/webpack.config'),
watchOptions: {}
}))
// on('file:preprocessor', webpack({
// webpackOptions: require('@vue/cli-service/webpack.config'),
// watchOptions: {}
// }))

return Object.assign({}, config, {
fixturesFolder: 'tests/e2e/fixtures',
Expand Down
4 changes: 0 additions & 4 deletions packages/@vue/cli-plugin-e2e-cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
"access": "public"
},
"dependencies": {
"@cypress/webpack-preprocessor": "^3.0.0",
"@vue/cli-shared-utils": "^3.1.1",
"cypress": "^3.1.0",
"eslint-plugin-cypress": "^2.0.1"
},
"peerDependencies": {
"@cypress/webpack-preprocessor": "^3.0.0"
}
}