Hello folks I need help for running component test...
# component-testing
r
Hello folks I need help for running component tests Project using react, react-scripts I was writing a test where component using a custom hook and got the error > An uncaught error was detected outside of a testfailed > No commands were issued in this test. > Error > The following error originated from your test code, not from Cypress. > > Cannot find module 'src/hooks' > > When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. > > Cypress could not associate this error to any specific test. > We dynamically generated a new test to display this failure. my config for component testing
Copy code
component: {
    viewportWidth: 500,
    viewportHeight: 500,
    setupNodeEvents(on, config) {
      // implement node event listeners here
      config.env.NODE_ENV = ENV;
    },
    specPattern: "src/**/*.cy.{js,ts,jsx,tsx}",
    devServer: {
      framework: "create-react-app",
      bundler: "webpack",
    },
  },
jsconfig.json
Copy code
{
  "target": "es2020",
  "module": "es6",
  "compilerOptions": {
    "baseUrl": "src",
    "paths": {
      "src/*": [
        "*"
      ],
      "server/*": [
        "../server/*"
      ],
      "tests/*": [
        "../tests/*"
      ]
    }
  },
  "include": [
    "src/**/*",
    "server/**/*",
    "tests/**/*"
  ]
}
package.json