Trying to integrate react unit testing in existing rails app. I am getting the below issue after I tried to render a component in test filecomprobar.prueba.tsx:
importar React desde "react"; importar * como ReactDOM desde 'react-dom'; import { render, fireEvent,queryByAttribute ,screen,cleanup,getByText} from "@testing-library/react";
import CustomDropdown,{APIResponse} from "../CustomDropdown"; function renderCustomDropdown(props: Partial<APIResponse> = {}) { const defaultProps: APIResponse = { validateFormHandler() { return; }, items: [], selectedItems: [], inputText: "", filteredsortByNameIDs: [], placeholderText: "", }; return render(<CustomDropdown {...defaultProps} {...props} />); }:El problema ocurre después de agregar render ()
ERROR in ./node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/DOMCollection.js rails_1 | Module parse failed: Unexpected token rails_1 | You may need an appropriate loader to handle this file type. rails_1 | | return props; rails_1 | | }, {}) rails_1 | | : {...collection}, rails_1 | | config, rails_1 | | indentation, Please help me out to fix this issue.