In order to pre-saturate my redux in Cypress tests, I need to dispatch. It works well, but whenever an error occurs or a test fails, I receive the following cryptic message:
Error: ENOENT: no such file or directory, stat '/Users/bill/Library/Application Support/Cypress/cy/production/projects/coresite-69f7195282475693846caddd826bc773/bundles/cypress/support/index.js'
This error occurred while Cypress was compiling and bundling the test code. This usually happens because of:
A missing file or dependency A syntax error in the file or one of its dependencies
To resolve this issue, I have to close my cypress tests and then restart with "npx cypress open". After that, everything works fine.
I believe the problem is related to my addition of the following code in the /plugins/index.js file
const wp = require("@cypress/webpack-preprocessor");
module.exports = (on) => {
const options = {
webpackOptions: require('../../webpack.config')({ env: 'development' }),
};
on('file:preprocessor', wp(options));
};
Any suggestions on how to fix this? I had to add that plugin because in one of my files, I'm using:
cy.on("emit:reduxStore", async (store) => {
store.dispatch(actions.updateAreas(data));
});