rapid-minister-30252
07/09/2022, 8:22 AMThe following error originated from your test code, not from Cypress.
> expected expression, got '<'
**My test**:
import MainMenu from '../../src/components/MainMenu';
import React from 'react';
describe('MainMenu.cy.js', () => {
it('should mount', () => {
cy.mount(<MainMenu />);
})
})
**Config files**:
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!