GeezerVison is showing github.com — remove OSS testing builds (#18138) · react/react@d28bd29
File treeExpand file treeCollapse file tree Open diff view settings fixtures/dom/src/__tests__
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: fixtures/dom/src/__tests__/nested-act-test.js +14-16Lines changed: 14 additions & 16 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | */ | 9 | 9 |
| 10 | 10 | let React; | 11 | | -let ReactDOM; | | 11 | +let DOMAct; | 12 | 12 | let TestRenderer; | | 13 | +let TestAct; | 13 | 14 |
| 14 | 15 | global.__DEV__ = process.env.NODE_ENV !== 'production'; | 15 | 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 | | - | 21 | 17 | expect.extend(require('../toWarnDev')); | 22 | 18 |
| 23 | 19 | describe('unmocked scheduler', () => { | 24 | 20 | beforeEach(() => { | 25 | 21 | jest.resetModules(); | 26 | 22 | React = require('react'); | 27 | | - ReactDOM = require('react-dom'); | | 23 | + DOMAct = require('react-dom/test-utils').act; | 28 | 24 | TestRenderer = require('react-test-renderer'); | | 25 | + TestAct = TestRenderer.act; | 29 | 26 | }); | 30 | 27 |
| 31 | 28 | it('flushes work only outside the outermost act() corresponding to its own renderer', () => { | @@ -37,8 +34,8 @@ describe('unmocked scheduler', () => { | 37 | 34 | return null; | 38 | 35 | } | 39 | 36 | // in legacy mode, this tests whether an act only flushes its own effects | 40 | | - TestRenderer.act(() => { | 41 | | - ReactDOM.act(() => { | | 37 | + TestAct(() => { | | 38 | + DOMAct(() => { | 42 | 39 | TestRenderer.create(<Effecty />); | 43 | 40 | }); | 44 | 41 | expect(log).toEqual([]); | @@ -47,8 +44,8 @@ describe('unmocked scheduler', () => { | 47 | 44 |
| 48 | 45 | log = []; | 49 | 46 | // for doublechecking, we flip it inside out, and assert on the outermost | 50 | | - ReactDOM.act(() => { | 51 | | - TestRenderer.act(() => { | | 47 | + DOMAct(() => { | | 48 | + TestAct(() => { | 52 | 49 | TestRenderer.create(<Effecty />); | 53 | 50 | }); | 54 | 51 | expect(log).toEqual(['called']); | @@ -64,8 +61,9 @@ describe('mocked scheduler', () => { | 64 | 61 | require.requireActual('scheduler/unstable_mock') | 65 | 62 | ); | 66 | 63 | React = require('react'); | 67 | | - ReactDOM = require('react-dom'); | | 64 | + DOMAct = require('react-dom/test-utils').act; | 68 | 65 | TestRenderer = require('react-test-renderer'); | | 66 | + TestAct = TestRenderer.act; | 69 | 67 | }); | 70 | 68 |
| 71 | 69 | afterEach(() => { | @@ -81,8 +79,8 @@ describe('mocked scheduler', () => { | 81 | 79 | return null; | 82 | 80 | } | 83 | 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(() => { | 86 | 84 | TestRenderer.create(<Effecty />); | 87 | 85 | }); | 88 | 86 | expect(log).toEqual([]); | @@ -91,8 +89,8 @@ describe('mocked scheduler', () => { | 91 | 89 |
| 92 | 90 | log = []; | 93 | 91 | // for doublechecking, we flip it inside out, and assert on the outermost | 94 | | - ReactDOM.act(() => { | 95 | | - TestRenderer.act(() => { | | 92 | + DOMAct(() => { | | 93 | + TestAct(() => { | 96 | 94 | TestRenderer.create(<Effecty />); | 97 | 95 | }); | 98 | 96 | expect(log).toEqual([]); | |
Collapse file Copy file name to clipboardExpand all lines: fixtures/dom/src/__tests__/wrong-act-test.js +9-12Lines changed: 9 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | let React; | 11 | 11 | let ReactDOM; | 12 | 12 | let ReactART; | | 13 | +let TestUtils; | 13 | 14 | let ARTSVGMode; | 14 | 15 | let ARTCurrentMode; | 15 | 16 | let TestRenderer; | @@ -18,11 +19,6 @@ let ARTTest; | 18 | 19 | global.__DEV__ = process.env.NODE_ENV !== 'production'; | 19 | 20 | global.__EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental'; | 20 | 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 | | - | 26 | 22 | expect.extend(require('../toWarnDev')); | 27 | 23 |
| 28 | 24 | function App(props) { | @@ -33,6 +29,7 @@ beforeEach(() => { | 33 | 29 | jest.resetModules(); | 34 | 30 | React = require('react'); | 35 | 31 | ReactDOM = require('react-dom'); | | 32 | + TestUtils = require('react-dom/test-utils'); | 36 | 33 | ReactART = require('react-art'); | 37 | 34 | ARTSVGMode = require('art/modes/svg'); | 38 | 35 | ARTCurrentMode = require('art/modes/current'); | @@ -73,7 +70,7 @@ beforeEach(() => { | 73 | 70 | }); | 74 | 71 |
| 75 | 72 | it("doesn't warn when you use the right act + renderer: dom", () => { | 76 | | - ReactDOM.act(() => { | | 73 | + TestUtils.act(() => { | 77 | 74 | ReactDOM.render(<App />, document.createElement('div')); | 78 | 75 | }); | 79 | 76 | }); | @@ -89,7 +86,7 @@ it('resets correctly across renderers', () => { | 89 | 86 | React.useEffect(() => {}, []); | 90 | 87 | return null; | 91 | 88 | } | 92 | | - ReactDOM.act(() => { | | 89 | + TestUtils.act(() => { | 93 | 90 | TestRenderer.act(() => {}); | 94 | 91 | expect(() => { | 95 | 92 | TestRenderer.create(<Effecty />); | @@ -126,7 +123,7 @@ it('warns when using the wrong act version - test + dom: updates', () => { | 126 | 123 |
| 127 | 124 | it('warns when using the wrong act version - dom + test: .create()', () => { | 128 | 125 | expect(() => { | 129 | | - ReactDOM.act(() => { | | 126 | + TestUtils.act(() => { | 130 | 127 | TestRenderer.create(<App />); | 131 | 128 | }); | 132 | 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()', () => { | 137 | 134 | it('warns when using the wrong act version - dom + test: .update()', () => { | 138 | 135 | const root = TestRenderer.create(<App key="one" />); | 139 | 136 | expect(() => { | 140 | | - ReactDOM.act(() => { | | 137 | + TestUtils.act(() => { | 141 | 138 | root.update(<App key="two" />); | 142 | 139 | }); | 143 | 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', () => { | 154 | 151 | } | 155 | 152 | TestRenderer.create(<Counter />); | 156 | 153 | expect(() => { | 157 | | - ReactDOM.act(() => { | | 154 | + TestUtils.act(() => { | 158 | 155 | setCtr(1); | 159 | 156 | }); | 160 | 157 | }).toWarnDev(["It looks like you're using the wrong act()"]); | 161 | 158 | }); | 162 | 159 |
| 163 | 160 | it('does not warn when nesting react-act inside react-dom', () => { | 164 | | - ReactDOM.act(() => { | | 161 | + TestUtils.act(() => { | 165 | 162 | ReactDOM.render(<ARTTest />, document.createElement('div')); | 166 | 163 | }); | 167 | 164 | }); | @@ -174,7 +171,7 @@ it('does not warn when nesting react-act inside react-test-renderer', () => { | 174 | 171 |
| 175 | 172 | it("doesn't warn if you use nested acts from different renderers", () => { | 176 | 173 | TestRenderer.act(() => { | 177 | | - ReactDOM.act(() => { | | 174 | + TestUtils.act(() => { | 178 | 175 | TestRenderer.create(<App />); | 179 | 176 | }); | 180 | 177 | }); | |
Collapse file Copy file name to clipboardExpand all lines: scripts/rollup/bundles.js -16Lines changed: 0 additions & 16 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -104,22 +104,6 @@ const bundles = [ | 104 | 104 | externals: ['react', 'react-dom'], | 105 | 105 | }, | 106 | 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 | | - | 123 | 107 | /******* React DOM - www - Testing *******/ | 124 | 108 | { | 125 | 109 | moduleType: RENDERER, | |
Collapse file Copy file name to clipboardExpand all lines: scripts/rollup/forks.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,7 +46,7 @@ const forks = Object.freeze({ | 46 | 46 | // Without this fork, importing `shared/ReactSharedInternals` inside | 47 | 47 | // the `react` package itself would not work due to a cyclical dependency. | 48 | 48 | 'shared/ReactSharedInternals': (bundleType, entry, dependencies) => { | 49 | | - if (entry === 'react' || entry === 'react/testing') { | | 49 | + if (entry === 'react') { | 50 | 50 | return 'react/src/ReactSharedInternals'; | 51 | 51 | } | 52 | 52 | if (dependencies.indexOf('react') === -1) { | @@ -107,7 +107,6 @@ const forks = Object.freeze({ | 107 | 107 | } | 108 | 108 | return 'shared/forks/ReactFeatureFlags.test-renderer.js'; | 109 | 109 | case 'react-dom/testing': | 110 | | - case 'react/testing': | 111 | 110 | switch (bundleType) { | 112 | 111 | case FB_WWW_DEV: | 113 | 112 | case FB_WWW_PROD: | |
|