Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed May 12, 2021
1 parent cbc99e3 commit afb46a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Expand Up @@ -58,7 +58,6 @@ describe('ReactIncrementalErrorHandling', () => {
);
}

// @gate experimental || !enableSyncDefaultUpdates
it('recovers from errors asynchronously', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
Expand Down Expand Up @@ -171,7 +170,6 @@ describe('ReactIncrementalErrorHandling', () => {
expect(ReactNoop.getChildren()).toEqual([span('Caught an error: oops!')]);
});

// @gate experimental || !enableSyncDefaultUpdates
it('recovers from errors asynchronously (legacy, no getDerivedStateFromError)', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
Expand Down Expand Up @@ -270,7 +268,6 @@ describe('ReactIncrementalErrorHandling', () => {
expect(ReactNoop.getChildren()).toEqual([span('Caught an error: oops!')]);
});

// @gate experimental
it("retries at a lower priority if there's additional pending work", async () => {
function App(props) {
if (props.isBroken) {
Expand Down Expand Up @@ -378,7 +375,6 @@ describe('ReactIncrementalErrorHandling', () => {
);
});

// @gate experimental || !enableSyncDefaultUpdates
it('retries one more time before handling error', () => {
function BadRender({unused}) {
Scheduler.unstable_yieldValue('BadRender');
Expand Down Expand Up @@ -429,7 +425,6 @@ describe('ReactIncrementalErrorHandling', () => {
expect(ReactNoop.getChildren()).toEqual([]);
});

// @gate experimental || !enableSyncDefaultUpdates
it('retries one more time if an error occurs during a render that expires midway through the tree', async () => {
function Oops({unused}) {
Scheduler.unstable_yieldValue('Oops');
Expand Down Expand Up @@ -566,7 +561,6 @@ describe('ReactIncrementalErrorHandling', () => {
expect(ReactNoop.getChildren()).toEqual([span('Caught an error: Hello.')]);
});

// @gate experimental || !enableSyncDefaultUpdates
it('catches render error in a boundary during partial deferred mounting', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
Expand Down Expand Up @@ -757,7 +751,6 @@ describe('ReactIncrementalErrorHandling', () => {
expect(ReactNoop.getChildren()).toEqual([]);
});

// @gate experimental || !enableSyncDefaultUpdates
it('propagates an error from a noop error boundary during partial deferred mounting', () => {
class RethrowErrorBoundary extends React.Component {
componentDidCatch(error) {
Expand Down Expand Up @@ -1842,7 +1835,6 @@ describe('ReactIncrementalErrorHandling', () => {
});
}

// @gate experimental
it('uncaught errors should be discarded if the render is aborted', async () => {
const root = ReactNoop.createRoot();

Expand Down Expand Up @@ -1875,7 +1867,6 @@ describe('ReactIncrementalErrorHandling', () => {
expect(root).toMatchRenderedOutput('Everything is fine.');
});

// @gate experimental
it('uncaught errors are discarded if the render is aborted, case 2', async () => {
const {useState} = React;
const root = ReactNoop.createRoot();
Expand Down
Expand Up @@ -370,9 +370,10 @@ describe('useMutableSourceHydration', () => {
expect(Scheduler).toHaveYielded(['0:a:one', '1:b:two']);
});

// @gate !enableSyncDefaultUpdates
it('should detect a tear during a higher priority interruption', () => {
const source = createSource('one');
const mutableSource = createMutableSource(source, param => param.version);
const mutableSource = Ω(source, param => param.version);

function Unrelated({flag}) {
Scheduler.unstable_yieldValue(flag);
Expand Down

0 comments on commit afb46a3

Please sign in to comment.