diff --git a/packages/react-dom/src/__tests__/ReactDOMFloat-test.js b/packages/react-dom/src/__tests__/ReactDOMFloat-test.js index 24586c756b1b2..7c022571fff12 100644 --- a/packages/react-dom/src/__tests__/ReactDOMFloat-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMFloat-test.js @@ -249,7 +249,14 @@ describe('ReactDOMFloat', () => { , ); - expect(Scheduler).toFlushWithoutYielding(); + try { + expect(Scheduler).toFlushWithoutYielding(); + } catch (e) { + // for DOMExceptions that happen when expecting this test to fail we need + // to clear the scheduler first otherwise the expected failure will fail + expect(Scheduler).toFlushWithoutYielding(); + throw e; + } expect(getMeaningfulChildren(document)).toEqual(