-
Notifications
You must be signed in to change notification settings - Fork 49.9k
Testing builds #18196
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
Testing builds #18196
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| 'use strict'; | ||
|
|
||
| if (process.env.NODE_ENV === 'production') { | ||
| module.exports = require('./cjs/react-dom-unstable-testing.production.min.js'); | ||
| } else { | ||
| module.exports = require('./cjs/react-dom-unstable-testing.development.js'); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -962,7 +962,7 @@ function mountEffect( | |
| ): void { | ||
| if (__DEV__) { | ||
| // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests | ||
| if ('undefined' !== typeof jest) { | ||
| if (__TESTING__ || 'undefined' !== typeof jest) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will "fix" #15439 |
||
| warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber); | ||
| } | ||
| } | ||
|
|
@@ -980,7 +980,7 @@ function updateEffect( | |
| ): void { | ||
| if (__DEV__) { | ||
| // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests | ||
| if ('undefined' !== typeof jest) { | ||
| if (__TESTING__ || 'undefined' !== typeof jest) { | ||
| warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber); | ||
| } | ||
| } | ||
|
|
@@ -1360,7 +1360,7 @@ function dispatchAction<S, A>( | |
| } | ||
| if (__DEV__) { | ||
| // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests | ||
| if ('undefined' !== typeof jest) { | ||
| if (__TESTING__ || 'undefined' !== typeof jest) { | ||
| warnIfNotScopedWithMatchingAct(fiber); | ||
| warnIfNotCurrentlyActingUpdatesInDev(fiber); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -789,7 +789,7 @@ function finishConcurrentRender( | |
| hasNotProcessedNewUpdates && | ||
| // do not delay if we're inside an act() scope | ||
| !( | ||
| __DEV__ && | ||
| (__DEV__ || __TESTING__) && | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need a plan for all the other warnings. Do we need to update all the other warning guards, too?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don’t think we have to change anything? |
||
| flushSuspenseFallbacksInTests && | ||
| IsThisRendererActing.current | ||
| ) | ||
|
|
@@ -855,7 +855,7 @@ function finishConcurrentRender( | |
| if ( | ||
| // do not delay if we're inside an act() scope | ||
| !( | ||
| __DEV__ && | ||
| (__DEV__ || __TESTING__) && | ||
| flushSuspenseFallbacksInTests && | ||
| IsThisRendererActing.current | ||
| ) | ||
|
|
@@ -946,7 +946,7 @@ function finishConcurrentRender( | |
| if ( | ||
| // do not delay if we're inside an act() scope | ||
| !( | ||
| __DEV__ && | ||
| (__DEV__ || __TESTING__) && | ||
| flushSuspenseFallbacksInTests && | ||
| IsThisRendererActing.current | ||
| ) && | ||
|
|
@@ -2815,7 +2815,9 @@ function warnAboutRenderPhaseUpdatesInDEV(fiber) { | |
| } | ||
|
|
||
| // a 'shared' variable that changes when act() opens/closes in tests. | ||
| export const IsThisRendererActing = {current: (false: boolean)}; | ||
| // $FlowExpectedError avoids a shape check on IsThisRendererActing | ||
| export const IsThisRendererActing: {current: boolean} = | ||
| __DEV__ || __TESTING__ ? {current: false} : null; | ||
|
|
||
| export function warnIfNotScopedWithMatchingAct(fiber: Fiber): void { | ||
| if (__DEV__) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| 'use strict'; | ||
|
|
||
| if (process.env.NODE_ENV === 'production') { | ||
| module.exports = require('./cjs/react-unstable-testing.production.min.js'); | ||
| } else { | ||
| module.exports = require('./cjs/react-unstable-testing.development.js'); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| "README.md", | ||
| "build-info.json", | ||
| "index.js", | ||
| "unstable-testing.js", | ||
| "cjs/", | ||
| "umd/" | ||
| ], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /** | ||
| * 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 | ||
| */ | ||
|
|
||
| export * from './index.classic.fb'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /** | ||
| * 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 | ||
| */ | ||
|
|
||
| export * from './index.experimental'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /** | ||
| * 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 | ||
| */ | ||
|
|
||
| export * from './index'; |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could probably remove this test. Or rewrite it to run across the dev/prod+testing matrix. Thinking about options, not blocking a review.