Hi everyone - quick question regarding setting up ...
# component-testing
r
Hi everyone - quick question regarding setting up the Test Components Runner with React and Vite. **My issue**: I get an error message when I try to mount the component, my guess is that the test runner doesn't like JSX. **Error message**:
Copy code
The following error originated from your test code, not from Cypress. 
> expected expression, got '<'
**My test**:
Copy code
import MainMenu from '../../src/components/MainMenu';
import React from 'react';

describe('MainMenu.cy.js', () => {
  it('should mount', () => {
    cy.mount(<MainMenu />);
  })
})
**Config files**:
Copy code
const { defineConfig } = require("cypress");
module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      // implement node event listeners here
    },
  },
  component: {
    devServer: {
      framework: "react",
      bundler: "vite",
    },
  },
});
I have the
support/component.js
file edited with the
Cypress.Commands.add('mount', mount)
**My setup**: * react 18.0.0 * cypress 10.3.0 * vite 2.9.9 I am just posting this in the case it is a pretty basic issue (e.g. "you forgot to import package XYZ"). If it takes too much time don't worry I'll end up figuring it out. Thanks!