Support for component testing on a Gatsby project? #25332
Unanswered
syntapy
asked this question in
Component Testing
Replies: 1 comment
-
Just found this unanswered in the top of search results while looking for similar issue. My stack is Vue2+Webpack, and that is how I had finally set up my config to work: //cypress.config.js
const { defineConfig } = require('cypress');
const WebpackConfig = require('./path/to/your/webpack.config');
module.exports = defineConfig({
....//your stuff here
component: {
devServer: {
webpackConfig: WebpackConfig,
framework: 'vue',
bundler: 'webpack'
}
}}) Important Cypress is installed safe-dev and config is in the project's root Hope it can help someone in need |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is this unsupported or am I doing something wrong? Is it planned to be supported? Here is my WIP codebase.
Basically when I set the bundler to webpack and try to run tests, I get:
My
cypress.config.js
isI know gatsby uses webpack
I tried a couple things such as setting
bundler
torequire("node_modules/gatsby/webpack.d.ts")
require("@cypress/webpack-dev-server")
to hopefully try out referring to Gatsby's webpack config directly or through the dev middleware maybe?... but those didn't work
I tried a couple tips from ChatGPT, such as setting my
gatsby-node.js
toand also adding
cypress/plugin/index.js
:Beta Was this translation helpful? Give feedback.
All reactions