Last active
August 11, 2019 19:23
-
-
Save BenBrostoff/934bb121200a78227578967b1a85494d to your computer and use it in GitHub Desktop.
Revisions
-
BenBrostoff revised this gist
Aug 11, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ 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); }); -
BenBrostoff created this gist
Aug 11, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ it('should render with the correct text without act', async () => { ReactDOM.render(<App/>, el); expect(el.innerHTML).toContain('unloaded val'); }); it('should render with the correct text with act', async () => { act(() => { ReactDOM.render(<App/>, el); }); expect(el.innerHTML).toContain('sync val'); });