overleaf/services/web/cypress/plugins/index.js
Alf Eaton 53324b0cd2 Add Cypress React component testing (#6974)
GitOrigin-RevId: 1260312a0644f3bc60e007a840045974336e264d
2022-04-05 12:17:30 +00:00

19 lines
562 B
JavaScript

module.exports = (on, config) => {
if (config.testingType === 'component') {
const { startDevServer } = require('@cypress/webpack-dev-server')
const merge = require('webpack-merge')
const path = require('path')
const devConfig = require('../../webpack.config.dev')
const webpackConfig = merge(devConfig, {
devServer: {
contentBase: path.join(__dirname, '../../../../public'),
stats: 'none',
},
})
on('dev-server:start', options => {
return startDevServer({ options, webpackConfig })
})
}
}