diff --git a/hooks/test/browser/useEffect.test.js b/hooks/test/browser/useEffect.test.js index bbab439405..a16d3fc1ec 100644 --- a/hooks/test/browser/useEffect.test.js +++ b/hooks/test/browser/useEffect.test.js @@ -337,7 +337,7 @@ describe('useEffect', () => { increment = () => { setCount(x => x + 1); - promise = Promise(res => { + promise = new Promise(res => { setTimeout(() => { setCount(x => x + 1); res(); @@ -364,10 +364,10 @@ describe('useEffect', () => { act(() => { increment(); }); - - await act(async () => { - await promise; - }); - expect(scratch.innerHTML).to.equal(''); + await promise; + act(() => {}); + expect(scratch.innerHTML).to.equal( + '
Count: 2
dummy
' + ); }); });