You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe("bla",()=>{letinstance;beforeAll(()=>{instance=render(<Blahooo={3}/>);});it("works when in one test",()=>{instance.rerender(<Blahooo={4}/>);instance.rerender(<Blahooo={5}/>);instance.rerender(<Blahooo={6}/>);// output id: 1, 2, 3, 4expect(true).toBe(true);});it("doesn't work 1",()=>{instance.rerender(<Blahooo={7}/>);// output id: 1expect(true).toBe(true);});it("doesn't work 2",()=>{instance.rerender(<Blahooo={8}/>);// output id: 1expect(true).toBe(true);});});
The text was updated successfully, but these errors were encountered:
Thank you for opening this issue and providing a reproduction.
This is expected. We automatically clean up between each test as of #430. It explains how you can disabled this behavior though we do not recommend it.
It appears that using re-render inside separate tests does not update props and instead re-renders the component from scratch. Is this by design?
See https://codesandbox.io/s/testing-libraryreact-re-render-issue-o1osd for a complete example
The text was updated successfully, but these errors were encountered: