python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
XMLHttpRequest mock - Jest mockImplementation doesn't create class with specified methods
I am trying to mock XMLHttpRequest but without success. Based on answers here I've managed to do following:
const xhrMockClass = () => ({
open: jest.fn(),
send: jest.fn(),
setRequestHeader: j...

karlosos
Votes: 0
Answers: 0
Testing react-leaflet marker click event triggers `Error: Invalid LatLng object: (NaN, NaN)`
I want to test click events on a react-leaftlet marker. I'm using jest alongside testing-library for the tests.
"react-leaflet": "^3.2.1"
"@testing-library/jest-dom": &qu...

fabrizzio_gz
Votes: 0
Answers: 0
Content cannot translated and tests are failed on jest in next-i18next
I am using Next-i18next package for my localization purposes in my project.
I successfully rendered translated content on my UI. But when I try to test my content and text with enzym (shallow testing)...

Efe Nadir
Votes: 0
Answers: 0
How to test a function in parent component that is passed as props to child component
I have a function onConfirm in parent component which I want to test using jest and react-testing-library, but this is passed as prop to the child component. How can I test this function in parent co...
Pratheek R
Votes: 0
Answers: 0