Last active
August 11, 2019 19:23
-
-
Save BenBrostoff/934bb121200a78227578967b1a85494d to your computer and use it in GitHub Desktop.
Pass / fail sync act
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should render with the correct text without act', () => { | |
ReactDOM.render(<App/>, el); | |
expect(el.innerHTML).toContain('unloaded val'); | |
}); | |
it('should render with the correct text with act', () => { | |
act(() => { | |
ReactDOM.render(<App/>, el); | |
}); | |
expect(el.innerHTML).toContain('sync val'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment