react-testing-library
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -5,2 +5,5 @@ "use strict"; | ||
jest.mock('../react-dom-16.9.0-is-released', () => ({ | ||
reactDomSixteenPointNineIsReleased: true | ||
})); | ||
jest.mock('react-dom/test-utils', () => ({ | ||
@@ -7,0 +10,0 @@ act: cb => { |
@@ -14,2 +14,4 @@ "use strict"; | ||
var _reactDom2 = require("./react-dom-16.9.0-is-released"); | ||
let reactAct; | ||
@@ -30,7 +32,8 @@ let actSupported = false; | ||
console.error.calls = []; | ||
/* istanbul ignore next */ | ||
reactAct(() => ({ | ||
then: () => {} | ||
})).then( | ||
})).then(() => {}); | ||
/* istanbul ignore next */ | ||
() => {}); | ||
@@ -61,3 +64,4 @@ if (!errorCalled) { | ||
async function asyncActPolyfill(cb) { | ||
if (!youHaveBeenWarned && actSupported) { | ||
// istanbul-ignore-next | ||
if (!youHaveBeenWarned && actSupported && _reactDom2.reactDomSixteenPointNineIsReleased) { | ||
// if act is supported and async act isn't and they're trying to use async | ||
@@ -73,4 +77,5 @@ // act, then they need to upgrade from 16.8 to 16.9. | ||
act(() => {}); | ||
} | ||
} // istanbul ignore next | ||
const asyncAct = asyncActSupported ? reactAct : asyncActPolyfill; | ||
@@ -77,0 +82,0 @@ exports.asyncAct = asyncAct; |
@@ -14,2 +14,5 @@ 'use strict'; | ||
// we don't want to warn until react-dom@16.9.0 is actually released | ||
var reactDomSixteenPointNineIsReleased = false; | ||
var reactAct; | ||
@@ -30,2 +33,4 @@ var actSupported = false; | ||
console.error.calls = []; | ||
/* istanbul ignore next */ | ||
reactAct(function () { | ||
@@ -35,5 +40,4 @@ return { | ||
}; | ||
}).then( | ||
}).then(function () {}); | ||
/* istanbul ignore next */ | ||
function () {}); | ||
@@ -64,4 +68,5 @@ if (!errorCalled) { | ||
return _asyncActPolyfill.apply(this, arguments); | ||
} | ||
} // istanbul ignore next | ||
function _asyncActPolyfill() { | ||
@@ -75,3 +80,4 @@ _asyncActPolyfill = _asyncToGenerator( | ||
case 0: | ||
if (!youHaveBeenWarned && actSupported) { | ||
// istanbul-ignore-next | ||
if (!youHaveBeenWarned && actSupported && reactDomSixteenPointNineIsReleased) { | ||
// if act is supported and async act isn't and they're trying to use async | ||
@@ -78,0 +84,0 @@ // act, then they need to upgrade from 16.8 to 16.9. |
@@ -9,2 +9,5 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
// we don't want to warn until react-dom@16.9.0 is actually released | ||
var reactDomSixteenPointNineIsReleased = false; | ||
var reactAct; | ||
@@ -25,2 +28,4 @@ var actSupported = false; | ||
console.error.calls = []; | ||
/* istanbul ignore next */ | ||
reactAct(function () { | ||
@@ -30,5 +35,4 @@ return { | ||
}; | ||
}).then( | ||
}).then(function () {}); | ||
/* istanbul ignore next */ | ||
function () {}); | ||
@@ -59,4 +63,5 @@ if (!errorCalled) { | ||
return _asyncActPolyfill.apply(this, arguments); | ||
} | ||
} // istanbul ignore next | ||
function _asyncActPolyfill() { | ||
@@ -70,3 +75,4 @@ _asyncActPolyfill = _asyncToGenerator( | ||
case 0: | ||
if (!youHaveBeenWarned && actSupported) { | ||
// istanbul-ignore-next | ||
if (!youHaveBeenWarned && actSupported && reactDomSixteenPointNineIsReleased) { | ||
// if act is supported and async act isn't and they're trying to use async | ||
@@ -73,0 +79,0 @@ // act, then they need to upgrade from 16.8 to 16.9. |
{ | ||
"name": "react-testing-library", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Simple and complete React DOM testing utilities that encourage good testing practices.", | ||
@@ -58,4 +58,4 @@ "main": "dist/index.js", | ||
"kcd-scripts": "1.1.2", | ||
"react": "16.9.0-alpha.0", | ||
"react-dom": "16.9.0-alpha.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-intl": "^2.8.0", | ||
@@ -62,0 +62,0 @@ "react-redux": "6.0.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1079098
30
7235