Skip to content

Commit

Permalink
fix: improve warning so people know they can upgrade to 16.9.0 now
Browse files Browse the repository at this point in the history
Closes #281
  • Loading branch information
Kent C. Dodds committed Aug 8, 2019
1 parent 98b9605 commit 01ab3ae
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -41,17 +41,17 @@
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.5.4",
"@testing-library/dom": "^5.5.4"
"@babel/runtime": "^7.5.5",
"@testing-library/dom": "^5.6.1"
},
"devDependencies": {
"@reach/router": "^1.2.1",
"@testing-library/jest-dom": "^4.0.0",
"@types/react": "^16.8.23",
"@types/react-dom": "^16.8.4",
"@types/react": "^16.8.25",
"@types/react-dom": "^16.8.5",
"kcd-scripts": "^1.5.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react": "^16.9.0",
"react-dom": "^16.9.0"
},
"peerDependencies": {
"react": "*",
Expand Down
4 changes: 0 additions & 4 deletions src/__tests__/old-act.js
Expand Up @@ -10,10 +10,6 @@ afterEach(() => {
console.error.mockRestore()
})

jest.mock('../react-dom-16.9.0-is-released', () => ({
reactDomSixteenPointNineIsReleased: true,
}))

jest.mock('react-dom/test-utils', () => ({
act: cb => {
cb()
Expand Down
3 changes: 1 addition & 2 deletions src/act-compat.js
@@ -1,7 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
import * as testUtils from 'react-dom/test-utils'
import {reactDomSixteenPointNineIsReleased} from './react-dom-16.9.0-is-released'

const reactAct = testUtils.act
const actSupported = reactAct !== undefined
Expand Down Expand Up @@ -76,7 +75,7 @@ function asyncAct(cb) {
if (isAsyncActSupported === false) {
console.error = originalConsoleError
/* istanbul-ignore-next */
if (!youHaveBeenWarned && reactDomSixteenPointNineIsReleased) {
if (!youHaveBeenWarned) {
// if act is supported and async act isn't and they're trying to use async
// act, then they need to upgrade from 16.8 to 16.9.
// This is a seemless upgrade, so we'll add a warning
Expand Down
2 changes: 0 additions & 2 deletions src/react-dom-16.9.0-is-released.js

This file was deleted.

0 comments on commit 01ab3ae

Please sign in to comment.