@samitouri / QOS-React-2 / commits / d28bd2994b

remove OSS testing builds (#18138)

The testing build versions of react-dom are included in the builds right now, but we're not ready to share them yet. This PR removes them for now (back soon for the next release)

Sunil Pai committed Feb 26, 2020 at 13:12 UTC d28bd2994b749c70233334f4105574b692e74980
4 files changed +24 -46
fixtures/dom/src/__tests__/nested-act-test.js
+14 -16
@@ -8,24 +8,21 @@
8 */
9
10 let React;
11 -let ReactDOM;
11 +let DOMAct;
12 let TestRenderer;
13 +let TestAct;
14
15 global.__DEV__ = process.env.NODE_ENV !== 'production';
16
16 -jest.mock('react-dom', () =>
17 - require.requireActual('react-dom/cjs/react-dom-testing.development.js')
18 -);
19 -// we'll replace the above with react/testing and react-dom/testing right before the next minor
20 -
17 expect.extend(require('../toWarnDev'));
18
19 describe('unmocked scheduler', () => {
20 beforeEach(() => {
21 jest.resetModules();
22 React = require('react');
27 - ReactDOM = require('react-dom');
23 + DOMAct = require('react-dom/test-utils').act;
24 TestRenderer = require('react-test-renderer');
25 + TestAct = TestRenderer.act;
26 });
27
28 it('flushes work only outside the outermost act() corresponding to its own renderer', () => {
@@ -37,8 +34,8 @@ describe('unmocked scheduler', () => {
34 return null;
35 }
36 // in legacy mode, this tests whether an act only flushes its own effects
40 - TestRenderer.act(() => {
41 - ReactDOM.act(() => {
37 + TestAct(() => {
38 + DOMAct(() => {
39 TestRenderer.create(<Effecty />);
40 });
41 expect(log).toEqual([]);
@@ -47,8 +44,8 @@ describe('unmocked scheduler', () => {
44
45 log = [];
46 // for doublechecking, we flip it inside out, and assert on the outermost
50 - ReactDOM.act(() => {
51 - TestRenderer.act(() => {
47 + DOMAct(() => {
48 + TestAct(() => {
49 TestRenderer.create(<Effecty />);
50 });
51 expect(log).toEqual(['called']);
@@ -64,8 +61,9 @@ describe('mocked scheduler', () => {
61 require.requireActual('scheduler/unstable_mock')
62 );
63 React = require('react');
67 - ReactDOM = require('react-dom');
64 + DOMAct = require('react-dom/test-utils').act;
65 TestRenderer = require('react-test-renderer');
66 + TestAct = TestRenderer.act;
67 });
68
69 afterEach(() => {
@@ -81,8 +79,8 @@ describe('mocked scheduler', () => {
79 return null;
80 }
81 // with a mocked scheduler, this tests whether it flushes all work only on the outermost act
84 - TestRenderer.act(() => {
85 - ReactDOM.act(() => {
82 + TestAct(() => {
83 + DOMAct(() => {
84 TestRenderer.create(<Effecty />);
85 });
86 expect(log).toEqual([]);
@@ -91,8 +89,8 @@ describe('mocked scheduler', () => {
89
90 log = [];
91 // for doublechecking, we flip it inside out, and assert on the outermost
94 - ReactDOM.act(() => {
95 - TestRenderer.act(() => {
92 + DOMAct(() => {
93 + TestAct(() => {
94 TestRenderer.create(<Effecty />);
95 });
96 expect(log).toEqual([]);
fixtures/dom/src/__tests__/wrong-act-test.js
+9 -12
@@ -10,6 +10,7 @@
10 let React;
11 let ReactDOM;
12 let ReactART;
13 +let TestUtils;
14 let ARTSVGMode;
15 let ARTCurrentMode;
16 let TestRenderer;
@@ -18,11 +19,6 @@ let ARTTest;
19 global.__DEV__ = process.env.NODE_ENV !== 'production';
20 global.__EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';
21
21 -jest.mock('react-dom', () =>
22 - require.requireActual('react-dom/cjs/react-dom-testing.development.js')
23 -);
24 -// we'll replace the above with react/testing and react-dom/testing right before the next minor
25 -
22 expect.extend(require('../toWarnDev'));
23
24 function App(props) {
@@ -33,6 +29,7 @@ beforeEach(() => {
29 jest.resetModules();
30 React = require('react');
31 ReactDOM = require('react-dom');
32 + TestUtils = require('react-dom/test-utils');
33 ReactART = require('react-art');
34 ARTSVGMode = require('art/modes/svg');
35 ARTCurrentMode = require('art/modes/current');
@@ -73,7 +70,7 @@ beforeEach(() => {
70 });
71
72 it("doesn't warn when you use the right act + renderer: dom", () => {
76 - ReactDOM.act(() => {
73 + TestUtils.act(() => {
74 ReactDOM.render(<App />, document.createElement('div'));
75 });
76 });
@@ -89,7 +86,7 @@ it('resets correctly across renderers', () => {
86 React.useEffect(() => {}, []);
87 return null;
88 }
92 - ReactDOM.act(() => {
89 + TestUtils.act(() => {
90 TestRenderer.act(() => {});
91 expect(() => {
92 TestRenderer.create(<Effecty />);
@@ -126,7 +123,7 @@ it('warns when using the wrong act version - test + dom: updates', () => {
123
124 it('warns when using the wrong act version - dom + test: .create()', () => {
125 expect(() => {
129 - ReactDOM.act(() => {
126 + TestUtils.act(() => {
127 TestRenderer.create(<App />);
128 });
129 }).toWarnDev(["It looks like you're using the wrong act()"], {
@@ -137,7 +134,7 @@ it('warns when using the wrong act version - dom + test: .create()', () => {
134 it('warns when using the wrong act version - dom + test: .update()', () => {
135 const root = TestRenderer.create(<App key="one" />);
136 expect(() => {
140 - ReactDOM.act(() => {
137 + TestUtils.act(() => {
138 root.update(<App key="two" />);
139 });
140 }).toWarnDev(["It looks like you're using the wrong act()"], {
@@ -154,14 +151,14 @@ it('warns when using the wrong act version - dom + test: updates', () => {
151 }
152 TestRenderer.create(<Counter />);
153 expect(() => {
157 - ReactDOM.act(() => {
154 + TestUtils.act(() => {
155 setCtr(1);
156 });
157 }).toWarnDev(["It looks like you're using the wrong act()"]);
158 });
159
160 it('does not warn when nesting react-act inside react-dom', () => {
164 - ReactDOM.act(() => {
161 + TestUtils.act(() => {
162 ReactDOM.render(<ARTTest />, document.createElement('div'));
163 });
164 });
@@ -174,7 +171,7 @@ it('does not warn when nesting react-act inside react-test-renderer', () => {
171
172 it("doesn't warn if you use nested acts from different renderers", () => {
173 TestRenderer.act(() => {
177 - ReactDOM.act(() => {
174 + TestUtils.act(() => {
175 TestRenderer.create(<App />);
176 });
177 });
scripts/rollup/bundles.js
-16
@@ -104,22 +104,6 @@ const bundles = [
104 externals: ['react', 'react-dom'],
105 },
106
107 - /******* React DOM - Testing *******/
108 - {
109 - moduleType: RENDERER,
110 - bundleTypes: [
111 - UMD_DEV,
112 - UMD_PROD,
113 - UMD_PROFILING,
114 - NODE_DEV,
115 - NODE_PROD,
116 - NODE_PROFILING,
117 - ],
118 - entry: 'react-dom/testing',
119 - global: 'ReactDOM',
120 - externals: ['react'],
121 - },
122 -
107 /******* React DOM - www - Testing *******/
108 {
109 moduleType: RENDERER,
scripts/rollup/forks.js
+1 -2
@@ -46,7 +46,7 @@ const forks = Object.freeze({
46 // Without this fork, importing `shared/ReactSharedInternals` inside
47 // the `react` package itself would not work due to a cyclical dependency.
48 'shared/ReactSharedInternals': (bundleType, entry, dependencies) => {
49 - if (entry === 'react' || entry === 'react/testing') {
49 + if (entry === 'react') {
50 return 'react/src/ReactSharedInternals';
51 }
52 if (dependencies.indexOf('react') === -1) {
@@ -107,7 +107,6 @@ const forks = Object.freeze({
107 }
108 return 'shared/forks/ReactFeatureFlags.test-renderer.js';
109 case 'react-dom/testing':
110 - case 'react/testing':
110 switch (bundleType) {
111 case FB_WWW_DEV:
112 case FB_WWW_PROD: