Skip to content

Cypress for Components Tests React configuration problem absolute path #20674

Discussion options

You must be logged in to vote

Hello Guys again,
I managed to do the following solution:

plugins/index.js

const { startDevServer } = require('@cypress/webpack-dev-server')
const webpackConfig = require('../../webpack.config.js')

module.exports = (on, config) => {
  on('dev-server:start', async (options) =>
    startDevServer({ options, webpackConfig }),
  )
  return config
}

cypress.json

{
  "component": {
    "componentFolder": "src/tests/unity"
  },
  "integrationFolder": "src/tests/integration"
}

webpack.config.js

var path = require('path')

module.exports = {
  mode: 'development',
  module: {
    rules: [
      {
        test: /\.js$|jsx/,
        exclude: [/node_modules/],
        use: [
          {
          …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gabrielppd77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant