mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
* Migrate conditional tests to gate pragma
I searched through the codebase for this pattern:
```js
describe('test suite', () => {
if (!__EXPERIMENTAL__) { // or some other condition
test("empty test so Jest doesn't complain", () => {});
return;
}
// Unless we're in experimental mode, none of the tests in this block
// will run.
})
```
and converted them to the `@gate` pragma instead.
The reason this pattern isn't preferred is because you end up disabling
more tests than you need to.
* Add flag for www release channels
Using a heuristic where I check a flag that is known to only be enabled
in www. I left a TODO to instead set the release channel explicitly in
each test config.
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
/**
|
|
* 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
|
|
*/
|
|
|
|
/**
|
|
* This is a renderer of React that doesn't have a render target output.
|
|
* It is useful to demonstrate the internals of the reconciler in isolation
|
|
* and for testing semantics of reconciliation separate from the host
|
|
* environment.
|
|
*/
|
|
|
|
import ReactFiberReconciler from 'react-reconciler';
|
|
import createReactNoop from './createReactNoop';
|
|
|
|
export const {
|
|
_Scheduler,
|
|
getChildren,
|
|
getPendingChildren,
|
|
getOrCreateRootContainer,
|
|
createRoot,
|
|
createBlockingRoot,
|
|
createLegacyRoot,
|
|
getChildrenAsJSX,
|
|
getPendingChildrenAsJSX,
|
|
createPortal,
|
|
render,
|
|
renderLegacySyncRoot,
|
|
renderToRootWithID,
|
|
unmountRootWithID,
|
|
findInstance,
|
|
flushNextYield,
|
|
flushWithHostCounters,
|
|
expire,
|
|
flushExpired,
|
|
batchedUpdates,
|
|
deferredUpdates,
|
|
unbatchedUpdates,
|
|
discreteUpdates,
|
|
flushDiscreteUpdates,
|
|
flushSync,
|
|
flushPassiveEffects,
|
|
act,
|
|
dumpTree,
|
|
getRoot,
|
|
} = createReactNoop(
|
|
ReactFiberReconciler, // reconciler
|
|
false, // useMutation
|
|
);
|