skip to Main Content

Can Reactjs test data endpoints?

Here I want to test the data output on the endpoint. My test: import { render, screen } from "@testing-library/react"; import axios from "axios"; import CompBuildingGeo from "./components/CompBuildingGeo"; import { getBuildingGEO } from "../../service/building"; const buildingGeo = async () =>…

VIEW QUESTION

TypeError: Cannot destructure property 'basename' of 'React__namespace.useContext(…)' as it is null – Reactjs

I'm performing React tests with Jest and after the test runs it returns the error TypeError: Cannot destructure property 'basename' of 'React__namespace.useContext(...)' as it is null. on the line render(<Carrinho ItensCarrinho={ itensCarrinho } incrementeCarrinho={ incrementeCarrinhoMock } decrementeCarrinho={ decrementeCarrinhoMock }/>);. I've…

VIEW QUESTION
Back To Top
Search