diff --git a/test-utils/src/index.js b/test-utils/src/index.js index f8df33393d..b6efc22d40 100644 --- a/test-utils/src/index.js +++ b/test-utils/src/index.js @@ -35,14 +35,17 @@ export function act(cb) { try { const result = cb(); if (isThenable(result)) { - return result.then(() => { - --actDepth; - }, (e) => { - --actDepth; - throw e; - }) + return result.then( + () => { + --actDepth; + }, + e => { + --actDepth; + throw e; + } + ); } - } catch(e) { + } catch (e) { --actDepth; throw e; } diff --git a/test-utils/test/shared/act.test.js b/test-utils/test/shared/act.test.js index af9823b906..0df1d02089 100644 --- a/test-utils/test/shared/act.test.js +++ b/test-utils/test/shared/act.test.js @@ -389,7 +389,7 @@ describe('act', () => { act(() => { tryRenderBroken(); }); - } + }; describe('synchronously', () => { it('should rethrow the exception', () => { @@ -407,7 +407,7 @@ describe('act', () => { renderWorking(); expect(scratch.textContent).to.equal('1'); }); - + it('should not affect effects in future renders', () => { tryRenderBroken(); renderWorking();