Skip to content

Commit

Permalink
Use @GATE www in ReactSuspenseCallback
Browse files Browse the repository at this point in the history
This allows it to not be internal anymore. We test it against the www build.
  • Loading branch information
sebmarkbage committed May 13, 2021
1 parent 4156271 commit b1d0fcf
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
'use strict';

let React;
let ReactFeatureFlags;
let ReactNoop;
let Scheduler;

describe('ReactSuspense', () => {
beforeEach(() => {
jest.resetModules();
ReactFeatureFlags = require('shared/ReactFeatureFlags');
ReactFeatureFlags.enableSuspenseCallback = true;

React = require('react');
ReactNoop = require('react-noop-renderer');
Expand Down Expand Up @@ -47,6 +44,7 @@ describe('ReactSuspense', () => {
return {promise, resolve, PromiseComp};
}

// @gate www
it('check type', () => {
const {PromiseComp} = createThenable();

Expand All @@ -71,6 +69,7 @@ describe('ReactSuspense', () => {
expect(() => Scheduler.unstable_flushAll()).toErrorDev([]);
});

// @gate www
it('1 then 0 suspense callback', async () => {
const {promise, resolve, PromiseComp} = createThenable();

Expand All @@ -97,6 +96,7 @@ describe('ReactSuspense', () => {
expect(ops).toEqual([]);
});

// @gate www
it('2 then 1 then 0 suspense callback', async () => {
const {
promise: promise1,
Expand Down Expand Up @@ -143,6 +143,7 @@ describe('ReactSuspense', () => {
expect(ops).toEqual([]);
});

// @gate www
it('nested suspense promises are reported only for their tier', () => {
const {promise, PromiseComp} = createThenable();

Expand Down Expand Up @@ -174,6 +175,7 @@ describe('ReactSuspense', () => {
expect(ops2).toEqual([new Set([promise])]);
});

// @gate www
it('competing suspense promises', async () => {
const {
promise: promise1,
Expand Down Expand Up @@ -242,6 +244,7 @@ describe('ReactSuspense', () => {
});

if (__DEV__) {
// @gate www
it('regression test for #16215 that relies on implementation details', async () => {
// Regression test for https://github.com/facebook/react/pull/16215.
// The bug only happens if there's an error earlier in the commit phase.
Expand Down Expand Up @@ -272,9 +275,6 @@ describe('ReactSuspense', () => {
},
}));

ReactFeatureFlags = require('shared/ReactFeatureFlags');
ReactFeatureFlags.enableSuspenseCallback = true;

React = require('react');
ReactNoop = require('react-noop-renderer');
Scheduler = require('scheduler');
Expand Down

0 comments on commit b1d0fcf

Please sign in to comment.