forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use testing builds for our own tests
Following up from facebook#17915 where we generated testing builds for `react-dom`, this PR uses those builds for our own tests. - fixes `ReactFeatureFlags.testing` to use all the default flags - changes `ReactFeatureFlags.readonly` to return `isTestEnvironment: true` (this might not strictly be needed) - with jest, mocks `react-dom` with the testing version, both for source and builds - uses `ReactDOM.act` in one of these tests to verify it actually works
- Loading branch information
1 parent
9e158c0
commit 7bf2df2
Showing
11 changed files
with
123 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
// keep in sync with forks/ReactFeatureFlags.testing.js | ||
// only isTestEnvironment is different, and true | ||
|
||
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags'; | ||
import typeof * as FeatureFlagsShimType from './ReactFeatureFlags.www'; | ||
|
||
// Re-export dynamic flags from the www version. | ||
export const { | ||
debugRenderPhaseSideEffectsForStrictMode, | ||
disableInputAttributeSyncing, | ||
enableTrustedTypesIntegration, | ||
deferPassiveEffectCleanupDuringUnmount, | ||
} = require('ReactFeatureFlags'); | ||
|
||
export { | ||
enableUserTimingAPI, | ||
replayFailedUnitOfWorkWithInvokeGuardedCallback, | ||
warnAboutDeprecatedLifecycles, | ||
enableProfilerTimer, | ||
enableSchedulerTracing, | ||
enableSuspenseServerRenderer, | ||
enableSelectiveHydration, | ||
enableChunksAPI, | ||
enableSchedulerDebugging, | ||
disableJavaScriptURLs, | ||
exposeConcurrentModeAPIs, | ||
warnAboutShorthandPropertyCollision, | ||
enableDeprecatedFlareAPI, | ||
enableFundamentalAPI, | ||
enableScopeAPI, | ||
enableJSXTransformAPI, | ||
warnAboutUnmockedScheduler, | ||
flushSuspenseFallbacksInTests, | ||
enableSuspenseCallback, | ||
warnAboutDefaultPropsOnFunctionComponents, | ||
disableSchedulerTimeoutBasedOnReactExpirationTime, | ||
enableTrainModelFix, | ||
enableNativeTargetAsInstance, | ||
warnAboutStringRefs, | ||
disableLegacyContext, | ||
disableCreateFactory, | ||
disableTextareaChildren, | ||
disableUnstableRenderSubtreeIntoContainer, | ||
warnUnstableRenderSubtreeIntoContainer, | ||
disableUnstableCreatePortal, | ||
addUserTimingListener, | ||
} from 'shared/ReactFeatureFlags.www'; | ||
|
||
export const isTestEnvironment = true; | ||
|
||
// Flow magic to verify the exports of this file match the original version. | ||
// eslint-disable-next-line no-unused-vars | ||
type Check<_X, Y: _X, X: Y = _X> = null; | ||
// eslint-disable-next-line no-unused-expressions | ||
(null: Check<FeatureFlagsShimType, FeatureFlagsType>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters