python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How to mock reducers/store on react-testing-library for all tests
In my tests I normally mock each and every dispatch/selector needed for each specific test. But I have one prop on my reducers/store that applies to almost all components. I always import it directly ...
Gabrielle
Votes: 0
Answers: 0
Issues with mock + multiple exports in the same file on react-testing-library
I am using Jest + React Testing Library in my project, and in one of my components, I have a common index.ts that exports all the internal components like:
src/components/commonComponents/index.ts:
im...
Gabrielle
Votes: 0
Answers: 0
Using react-testing-library without global-jsdom
I want to be able to setup specific instances of window and document for use by render(). I can specify the container by creating a specific instance of jsdom thus:
this.dom = new JSDOM('<...
Dave Meehan
Votes: 0
Answers: 0
What do I wrap in `act` for state changes that are triggered by time and using modern fake timers
I have small hook that I wrote to avoid re-rendering when the component is unmounted.
it("should work and not rerender and unmount later", () => {
jest.useFakeTimers('modern');
...
Archimedes Trajano
Votes: 0
Answers: 1