You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
findReactScriptsWebpackConfig is returning "undefined" for react-script webpack configuration in version 5.9.0.
Desired behavior
findReactScriptsWebpackConfig was returning react-scripts webpack configuration in version 5.8.0, both with cypress-run and cypress run-ct.
Test code to reproduce
In plugin/index.js, we setup the following for unit/component testing code coverage:
importinjectDevServerfrom'@cypress/react/plugins/react-scripts';importfindReactScriptsWebpackConfigfrom'@cypress/react/plugins/react-scripts/findReactScriptsWebpackConfig';import{startDevServer}from'@cypress/webpack-dev-server';// Code coverageimportcodeCoverageTaskfrom'@cypress/code-coverage/task';// This function is called when a project is opened or re-opened (e.g. due to// the project's config changing)/** * @type {Cypress.PluginConfig} */module.exports=(on,config)=>{// `on` is used to hook into various events Cypress emits// `config` is the resolved Cypress configcodeCoverageTask(on,config);// Component testing web dev server setup for code coverageinjectDevServer(on,config);constwebpackConfig=findReactScriptsWebpackConfig(config);construles=webpackConfig.module.rules.find((rule)=>!!rule.oneOf).oneOf;constbabelRule=rules.find((rule)=>/babel-loader/.test(rule.loader));babelRule.options.plugins.push(require.resolve('babel-plugin-istanbul'));
Versions
Create-React-App 4.0.3
@cypress/react: 5.9.0
The text was updated successfully, but these errors were encountered:
@jennifer-shehane , correct, the default CRA path was replaced by a variable, would have been nice to substitute CRA value if no value provided, for backward-compatibility.
Current behavior
findReactScriptsWebpackConfig is returning "undefined" for react-script webpack configuration in version 5.9.0.
Desired behavior
findReactScriptsWebpackConfig was returning react-scripts webpack configuration in version 5.8.0, both with
cypress-run
andcypress run-ct
.Test code to reproduce
In plugin/index.js, we setup the following for unit/component testing code coverage:
Versions
Create-React-App 4.0.3
@cypress/react: 5.9.0
The text was updated successfully, but these errors were encountered: