Skip to content

Commit 31fb40a

Browse files
committed
Float is currently being tested only with the external runtime. This runtime is unstable and should not be part of stable builds and we should still be testing the integrated Fizz runtime. This change forks the Float tests to ensure we test with and without the external Fizz runtime
1 parent 7f93cb4 commit 31fb40a

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ module.exports = {
336336
'packages/eslint-plugin-react-hooks/**/*.js',
337337
'packages/jest-react/**/*.js',
338338
'packages/internal-test-utils/**/*.js',
339-
'packages/**/__tests__/*.js',
339+
'packages/**/__tests__/**/*.js',
340340
'packages/**/npm/*.js',
341341
],
342342
rules: {

packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe('ReactDOMFizzServer', () => {
153153
});
154154

155155
renderOptions = {};
156-
if (gate(flags => flags.enableFizzExternalRuntime)) {
156+
if (gate(flags => flags.shouldUseFizzExternalRuntime)) {
157157
renderOptions.unstable_externalRuntimeSrc =
158158
'react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js';
159159
}
@@ -610,7 +610,7 @@ describe('ReactDOMFizzServer', () => {
610610
Array.from(container.getElementsByTagName('script')).filter(
611611
node => node.getAttribute('nonce') === CSPnonce,
612612
).length,
613-
).toEqual(6);
613+
).toEqual(gate(flags => flags.shouldUseFizzExternalRuntime) ? 6 : 5);
614614

615615
await act(() => {
616616
resolve({default: Text});
@@ -4292,7 +4292,7 @@ describe('ReactDOMFizzServer', () => {
42924292
);
42934293
});
42944294

4295-
// @gate enableFizzExternalRuntime
4295+
// @gate shouldUseFizzExternalRuntime
42964296
it('does not send script tags for SSR instructions when using the external runtime', async () => {
42974297
function App() {
42984298
return (

packages/react-dom/src/__tests__/ReactDOMFloat-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('ReactDOMFloat', () => {
9797
});
9898

9999
renderOptions = {};
100-
if (gate(flags => flags.enableFizzExternalRuntime)) {
100+
if (gate(flags => flags.shouldUseFizzExternalRuntime)) {
101101
renderOptions.unstable_externalRuntimeSrc =
102102
'react-dom/unstable_server-external-runtime';
103103
}

scripts/jest/TestFlags.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ function getTestFlags() {
8383
enableSuspenseList: releaseChannel === 'experimental' || www,
8484
enableLegacyHidden: www,
8585

86+
// This flag is used to determine whether we should run Fizz tests using
87+
// the external runtime or the inline script runtime.
88+
// For Meta we use variant to gate the feature. For OSS we use experimental
89+
shouldUseFizzExternalRuntime: !featureFlags.enableFizzExternalRuntime
90+
? false
91+
: www
92+
? __VARIANT__
93+
: __EXPERIMENTAL__,
94+
8695
// This is used by useSyncExternalStoresShared-test.js to decide whether
8796
// to test the shim or the native implementation of useSES.
8897
// TODO: It's disabled when enableRefAsProp is on because the JSX

0 commit comments

Comments
 (0)