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

Add React Native test configs #27489

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Oct 9, 2023

Adds new Jest configs for running our test suite using React Native feature flags. This includes a special config for the version of RN that Meta uses for internal dogfooding, similar to the equivalent ones used for Meta's web codebase.

Practically speaking, the main benefit is we can run our tests in CI with the experimental flags used at Meta without having to enable them in the open source builds.

Usage:

yarn test -r=native-oss
yarn test -r=native-fb
yarn test -r=native-fb --no-variant

Adds new Jest configs for running our test suite using React Native
feature flags. This includes a special config for the version of RN
that Meta uses for internal dogfooding, similar to the equivalent ones
used for Meta's web codebase.

Practically speaking, the main benefit is we can run our tests in CI
with the experimental flags used at Meta without having to enable them
in the open source builds.

Usage:
  yarn test -r=native-oss
  yarn test -r=native-fb
  yarn test -r=native-fb --no-variant
@react-sizebot
Copy link

Comparing: dddfe68...3ba58db

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 174.46 kB 174.46 kB = 54.27 kB 54.27 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 176.31 kB 176.31 kB = 54.88 kB 54.88 kB
facebook-www/ReactDOM-prod.classic.js = 564.48 kB 564.48 kB = 99.37 kB 99.37 kB
facebook-www/ReactDOM-prod.modern.js = 548.21 kB 548.21 kB = 96.44 kB 96.44 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 3ba58db

@acdlite
Copy link
Collaborator Author

acdlite commented Oct 9, 2023

Some of the tests are failing but I believe they are legit failures exposed by the additional test coverage, I'll look into them

@acdlite acdlite marked this pull request as draft October 9, 2023 17:49
//
// TODO: __VARIANT__ isn't supported for React Native flags yet. You can set the
// flag here but it won't be set to `true` in any of our test runs. Need to
// update the test configuration.

Copy link
Member

Choose a reason for hiding this comment

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

How does the import here not just a circular dependency? The ReactNativeInternalFeatureFlags import should suffice, since that's defined in flow/xplat.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants