I have a react component library which is bundled using Rollup. I want to add cypress component testing so that I can unit test those components using cypress.
Cypress currently supports setting automatic configuration for React using either webpack' bundler or
vite` bundler.
export default defineConfig({
component: {
devServer: {
bundler: 'vite', // or it can be webpack
framework:'react',
}
},
if we have anything apart from webpack or vite, we need to return custom-server instance from the devserver function as mentioned in the documentation
module.exports = defineConfig({
component: {
devServer(cypressConfig) {
// return dev server instance or a promise that resolves to
// a dev server instance here
},
},
})
I am not understanding how to return that devserver instance.