[FB] use modern entrypoint in tests (#28724)
Removes the entrypoint hack in tests since we gate legacy mode tests now
Josh Story committed
Apr 2, 2024 at 22:23 UTC
cb6dc7a6a03ea10a38b84e9e5737739e0d468435
3 files changed
+4
-8
packages/react-dom/src/__tests__/ReactDOMRoot-test.js
+2
-2
@@ -47,7 +47,7 @@ describe('ReactDOMRoot', () => {
47
expect(container.textContent).toEqual('Hi');
48
});
49
50
- // @gate !classic || !__DEV__
50
+ // @gate !www || !__DEV__
51
it('warns if you import createRoot from react-dom', async () => {
52
expect(() => ReactDOM.createRoot(container)).toErrorDev(
53
'You are importing createRoot from "react-dom" which is not supported. ' +
@@ -58,7 +58,7 @@ describe('ReactDOMRoot', () => {
58
);
59
});
60
61
- // @gate !classic || !__DEV__
61
+ // @gate !www || !__DEV__
62
it('warns if you import hydrateRoot from react-dom', async () => {
63
expect(() => ReactDOM.hydrateRoot(container, null)).toErrorDev(
64
'You are importing hydrateRoot from "react-dom" which is not supported. ' +
packages/react/index.modern.fb.js
+2
-1
@@ -33,6 +33,7 @@ export {
33
unstable_Activity,
34
unstable_Scope,
35
unstable_SuspenseList,
36
+ unstable_TracingMarker,
37
unstable_getCacheForType,
38
unstable_useCacheRefresh,
39
unstable_useMemoCache,
@@ -48,10 +49,10 @@ export {
49
useLayoutEffect,
50
useMemo,
51
useOptimistic,
52
+ useSyncExternalStore,
53
useReducer,
54
useRef,
55
useState,
54
- useSyncExternalStore,
56
useTransition,
57
useActionState,
58
version,
scripts/jest/setupHostConfigs.js
-5
@@ -14,11 +14,6 @@ function resolveEntryFork(resolvedEntry, isFBBundle) {
14
// .js
15
16
if (isFBBundle) {
17
- if (__EXPERIMENTAL__) {
18
- // We can't currently use the true modern entry point because too many tests fail.
19
- // TODO: Fix tests to not use ReactDOM.render or gate them. Then we can remove this.
20
- return resolvedEntry;
21
- }
17
const resolvedFBEntry = resolvedEntry.replace(
18
'.js',
19
__EXPERIMENTAL__ ? '.modern.fb.js' : '.classic.fb.js'