File tree 4 files changed +19
-4
lines changed
4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 55
55
"jest-dom" : " 3.1.3" ,
56
56
"jest-in-case" : " ^1.0.2" ,
57
57
"kcd-scripts" : " 1.1.2" ,
58
- "react" : " 16.9.0-alpha.0 " ,
59
- "react-dom" : " 16.9.0-alpha.0 " ,
58
+ "react" : " ^ 16.8.6 " ,
59
+ "react-dom" : " ^ 16.8.6 " ,
60
60
"react-intl" : " ^2.8.0" ,
61
61
"react-redux" : " 6.0.1" ,
62
62
"react-router" : " ^5.0.0" ,
Original file line number Diff line number Diff line change 1
1
import { asyncAct } from '../act-compat'
2
2
3
+ jest . mock ( '../react-dom-16.9.0-is-released' , ( ) => ( {
4
+ reactDomSixteenPointNineIsReleased : true ,
5
+ } ) )
6
+
3
7
jest . mock ( 'react-dom/test-utils' , ( ) => ( {
4
8
act : cb => {
5
9
const promise = cb ( )
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import ReactDOM from 'react-dom'
3
+ import { reactDomSixteenPointNineIsReleased } from './react-dom-16.9.0-is-released'
3
4
4
5
let reactAct
5
6
let actSupported = false
14
15
errorCalled = true
15
16
}
16
17
console . error . calls = [ ]
17
- reactAct ( ( ) => ( { then : ( ) => { } } ) ) . then ( /* istanbul ignore next */ ( ) => { } )
18
+ /* istanbul ignore next */
19
+ reactAct ( ( ) => ( { then : ( ) => { } } ) ) . then ( ( ) => { } )
20
+ /* istanbul ignore next */
18
21
if ( ! errorCalled ) {
19
22
asyncActSupported = true
20
23
}
@@ -39,7 +42,12 @@ let youHaveBeenWarned = false
39
42
// state updates asynchronously, but at least we can tell people they need
40
43
// to upgrade to avoid the warnings.
41
44
async function asyncActPolyfill ( cb ) {
42
- if ( ! youHaveBeenWarned && actSupported ) {
45
+ // istanbul-ignore-next
46
+ if (
47
+ ! youHaveBeenWarned &&
48
+ actSupported &&
49
+ reactDomSixteenPointNineIsReleased
50
+ ) {
43
51
// if act is supported and async act isn't and they're trying to use async
44
52
// act, then they need to upgrade from 16.8 to 16.9.
45
53
// This is a seemless upgrade, so we'll add a warning
@@ -53,6 +61,7 @@ async function asyncActPolyfill(cb) {
53
61
act ( ( ) => { } )
54
62
}
55
63
64
+ // istanbul ignore next
56
65
const asyncAct = asyncActSupported ? reactAct : asyncActPolyfill
57
66
58
67
export default act
Original file line number Diff line number Diff line change
1
+ // we don't want to warn until [email protected] is actually released
2
+ export const reactDomSixteenPointNineIsReleased = false
You can’t perform that action at this time.
0 commit comments