Skip to content

Commit d01dfa0

Browse files
author
Kent C. Dodds
committed
fix: improve warning so people know they can upgrade to 16.9.0 now
Closes #281
1 parent 98b9605 commit d01dfa0

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@
4141
"author": "Kent C. Dodds <[email protected]> (http://kentcdodds.com/)",
4242
"license": "MIT",
4343
"dependencies": {
44-
"@babel/runtime": "^7.5.4",
45-
"@testing-library/dom": "^5.5.4"
44+
"@babel/runtime": "^7.5.5",
45+
"@testing-library/dom": "^5.6.1"
4646
},
4747
"devDependencies": {
4848
"@reach/router": "^1.2.1",
4949
"@testing-library/jest-dom": "^4.0.0",
50-
"@types/react": "^16.8.23",
51-
"@types/react-dom": "^16.8.4",
50+
"@types/react": "^16.8.25",
51+
"@types/react-dom": "^16.8.5",
5252
"kcd-scripts": "^1.5.2",
53-
"react": "^16.8.6",
54-
"react-dom": "^16.8.6"
53+
"react": "^16.9.0",
54+
"react-dom": "^16.9.0"
5555
},
5656
"peerDependencies": {
5757
"react": "*",

src/__tests__/old-act.js

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ afterEach(() => {
1010
console.error.mockRestore()
1111
})
1212

13-
jest.mock('../react-dom-16.9.0-is-released', () => ({
14-
reactDomSixteenPointNineIsReleased: true,
15-
}))
16-
1713
jest.mock('react-dom/test-utils', () => ({
1814
act: cb => {
1915
cb()

src/act-compat.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom'
33
import * as testUtils from 'react-dom/test-utils'
4-
import {reactDomSixteenPointNineIsReleased} from './react-dom-16.9.0-is-released'
54

65
const reactAct = testUtils.act
76
const actSupported = reactAct !== undefined
@@ -28,6 +27,7 @@ function asyncAct(cb) {
2827
const originalConsoleError = console.error
2928
console.error = function error(...args) {
3029
/* if console.error fired *with that specific message* */
30+
/* istanbul ignore next */
3131
if (
3232
args[0].indexOf(
3333
'Warning: Do not await the result of calling ReactTestUtils.act',
@@ -75,8 +75,8 @@ function asyncAct(cb) {
7575

7676
if (isAsyncActSupported === false) {
7777
console.error = originalConsoleError
78-
/* istanbul-ignore-next */
79-
if (!youHaveBeenWarned && reactDomSixteenPointNineIsReleased) {
78+
/* istanbul ignore next */
79+
if (!youHaveBeenWarned) {
8080
// if act is supported and async act isn't and they're trying to use async
8181
// act, then they need to upgrade from 16.8 to 16.9.
8282
// This is a seemless upgrade, so we'll add a warning

src/react-dom-16.9.0-is-released.js

-2
This file was deleted.

0 commit comments

Comments
 (0)