Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RTR usage in ReactLazy-test #28598

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove feature flag override in test
  • Loading branch information
Jack Pope committed Mar 20, 2024
commit d5d4adeb10ac8886d2163608d54cd3b57e15fd9c
10 changes: 0 additions & 10 deletions packages/react-reconciler/src/__tests__/ReactLazy-test.internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ let waitForAll;
let waitForThrow;
let assertLog;
let act;
let ReactFeatureFlags;

let fakeModuleCache;

Expand All @@ -24,7 +23,6 @@ function normalizeCodeLocInfo(str) {
describe('ReactLazy', () => {
beforeEach(() => {
jest.resetModules();
ReactFeatureFlags = require('shared/ReactFeatureFlags');
React = require('react');
Suspense = React.Suspense;
lazy = React.lazy;
Expand Down Expand Up @@ -1453,14 +1451,6 @@ describe('ReactLazy', () => {
});

describe('legacy mode', () => {
beforeEach(() => {
ReactFeatureFlags.disableLegacyMode = false;
});

afterEach(() => {
ReactFeatureFlags.disableLegacyMode = true;
});

it('mount and reorder lazy elements (legacy mode)', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work to gate this code instead of setting the feature flag?

Suggested change
it('mount and reorder lazy elements (legacy mode)', async () => {
// @gate disableLegacyMode
it('mount and reorder lazy elements (legacy mode)', async () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They won't fail with the flag off until #28498

I've been trying to pull out the bulk of the test migrations out of that PR to simplify things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the flag setting here and add the gate in #28498

class Child extends React.Component {
componentDidMount() {
Expand Down