@testing-library/react
Advanced tools
Comparing version 13.0.0-alpha.4 to 13.0.0-alpha.5
@@ -5,9 +5,9 @@ 'use strict'; | ||
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
var testUtils = require('react-dom/test-utils'); | ||
var _extends = require('@babel/runtime/helpers/extends'); | ||
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator'); | ||
var _regeneratorRuntime = require('@babel/runtime/regenerator'); | ||
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
var dom = require('@testing-library/dom'); | ||
var testUtils = require('react-dom/test-utils'); | ||
@@ -34,8 +34,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var React__namespace = /*#__PURE__*/_interopNamespace(React); | ||
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM); | ||
var testUtils__namespace = /*#__PURE__*/_interopNamespace(testUtils); | ||
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends); | ||
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator); | ||
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime); | ||
var React__namespace = /*#__PURE__*/_interopNamespace(React); | ||
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM); | ||
var testUtils__namespace = /*#__PURE__*/_interopNamespace(testUtils); | ||
@@ -77,3 +77,3 @@ var isomorphicAct = React__namespace.unstable_act; | ||
function setReactActEnvironment(isReactActEnvironment) { | ||
function setIsReactActEnvironment(isReactActEnvironment) { | ||
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = isReactActEnvironment; | ||
@@ -89,3 +89,3 @@ } | ||
var previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(true); | ||
setIsReactActEnvironment(true); | ||
@@ -110,6 +110,6 @@ try { | ||
thenable.then(function (returnValue) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
resolve(returnValue); | ||
}, function (error) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
reject(error); | ||
@@ -120,3 +120,3 @@ }); | ||
} else { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return actResult; | ||
@@ -127,3 +127,3 @@ } | ||
// or if we have to await the callback first. | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
throw error; | ||
@@ -388,3 +388,3 @@ } | ||
previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(false); | ||
setIsReactActEnvironment(false); | ||
_context3.prev = 2; | ||
@@ -399,3 +399,3 @@ _context3.next = 5; | ||
_context3.prev = 6; | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return _context3.finish(6); | ||
@@ -640,2 +640,17 @@ | ||
}); | ||
} // No test setup with other test runners available | ||
/* istanbul ignore else */ | ||
if (typeof beforeAll === 'function' && typeof afterAll === 'function') { | ||
// This matches the behavior of React < 18. | ||
var previousIsReactActEnvironment = getIsReactActEnvironment(); | ||
beforeAll(function () { | ||
previousIsReactActEnvironment = getIsReactActEnvironment(); | ||
setIsReactActEnvironment(true); | ||
}); | ||
afterAll(function () { | ||
setIsReactActEnvironment(previousIsReactActEnvironment); | ||
}); | ||
} | ||
@@ -642,0 +657,0 @@ } |
@@ -0,9 +1,9 @@ | ||
import * as React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import * as testUtils from 'react-dom/test-utils'; | ||
import _extends from '@babel/runtime/helpers/esm/extends'; | ||
import _asyncToGenerator from '@babel/runtime/helpers/esm/asyncToGenerator'; | ||
import _regeneratorRuntime from '@babel/runtime/regenerator'; | ||
import * as React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { fireEvent as fireEvent$1, configure, prettyDOM, getQueriesForElement } from '@testing-library/dom'; | ||
export * from '@testing-library/dom'; | ||
import * as testUtils from 'react-dom/test-utils'; | ||
@@ -45,3 +45,3 @@ var isomorphicAct = React.unstable_act; | ||
function setReactActEnvironment(isReactActEnvironment) { | ||
function setIsReactActEnvironment(isReactActEnvironment) { | ||
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = isReactActEnvironment; | ||
@@ -57,3 +57,3 @@ } | ||
var previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(true); | ||
setIsReactActEnvironment(true); | ||
@@ -78,6 +78,6 @@ try { | ||
thenable.then(function (returnValue) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
resolve(returnValue); | ||
}, function (error) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
reject(error); | ||
@@ -88,3 +88,3 @@ }); | ||
} else { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return actResult; | ||
@@ -95,3 +95,3 @@ } | ||
// or if we have to await the callback first. | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
throw error; | ||
@@ -356,3 +356,3 @@ } | ||
previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(false); | ||
setIsReactActEnvironment(false); | ||
_context3.prev = 2; | ||
@@ -367,3 +367,3 @@ _context3.next = 5; | ||
_context3.prev = 6; | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return _context3.finish(6); | ||
@@ -608,2 +608,17 @@ | ||
}); | ||
} // No test setup with other test runners available | ||
/* istanbul ignore else */ | ||
if (typeof beforeAll === 'function' && typeof afterAll === 'function') { | ||
// This matches the behavior of React < 18. | ||
var previousIsReactActEnvironment = getIsReactActEnvironment(); | ||
beforeAll(function () { | ||
previousIsReactActEnvironment = getIsReactActEnvironment(); | ||
setIsReactActEnvironment(true); | ||
}); | ||
afterAll(function () { | ||
setIsReactActEnvironment(previousIsReactActEnvironment); | ||
}); | ||
} | ||
@@ -610,0 +625,0 @@ } |
@@ -75,3 +75,3 @@ 'use strict'; | ||
function setReactActEnvironment(isReactActEnvironment) { | ||
function setIsReactActEnvironment(isReactActEnvironment) { | ||
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = isReactActEnvironment; | ||
@@ -87,3 +87,3 @@ } | ||
var previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(true); | ||
setIsReactActEnvironment(true); | ||
@@ -108,6 +108,6 @@ try { | ||
thenable.then(function (returnValue) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
resolve(returnValue); | ||
}, function (error) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
reject(error); | ||
@@ -118,3 +118,3 @@ }); | ||
} else { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return actResult; | ||
@@ -125,3 +125,3 @@ } | ||
// or if we have to await the callback first. | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
throw error; | ||
@@ -386,3 +386,3 @@ } | ||
previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(false); | ||
setIsReactActEnvironment(false); | ||
_context3.prev = 2; | ||
@@ -397,3 +397,3 @@ _context3.next = 5; | ||
_context3.prev = 6; | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return _context3.finish(6); | ||
@@ -400,0 +400,0 @@ |
@@ -45,3 +45,3 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
function setReactActEnvironment(isReactActEnvironment) { | ||
function setIsReactActEnvironment(isReactActEnvironment) { | ||
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = isReactActEnvironment; | ||
@@ -57,3 +57,3 @@ } | ||
var previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(true); | ||
setIsReactActEnvironment(true); | ||
@@ -78,6 +78,6 @@ try { | ||
thenable.then(function (returnValue) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
resolve(returnValue); | ||
}, function (error) { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
reject(error); | ||
@@ -88,3 +88,3 @@ }); | ||
} else { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return actResult; | ||
@@ -95,3 +95,3 @@ } | ||
// or if we have to await the callback first. | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
throw error; | ||
@@ -356,3 +356,3 @@ } | ||
previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(false); | ||
setIsReactActEnvironment(false); | ||
_context3.prev = 2; | ||
@@ -367,3 +367,3 @@ _context3.next = 5; | ||
_context3.prev = 6; | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return _context3.finish(6); | ||
@@ -370,0 +370,0 @@ |
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.getIsReactActEnvironment = getIsReactActEnvironment; | ||
exports.setReactActEnvironment = setReactActEnvironment; | ||
exports.setReactActEnvironment = setIsReactActEnvironment; | ||
@@ -60,3 +60,3 @@ var React = _interopRequireWildcard(require("react")); | ||
function setReactActEnvironment(isReactActEnvironment) { | ||
function setIsReactActEnvironment(isReactActEnvironment) { | ||
getGlobalThis().IS_REACT_ACT_ENVIRONMENT = isReactActEnvironment; | ||
@@ -72,3 +72,3 @@ } | ||
const previousActEnvironment = getIsReactActEnvironment(); | ||
setReactActEnvironment(true); | ||
setIsReactActEnvironment(true); | ||
@@ -93,6 +93,6 @@ try { | ||
thenable.then(returnValue => { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
resolve(returnValue); | ||
}, error => { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
reject(error); | ||
@@ -103,3 +103,3 @@ }); | ||
} else { | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
return actResult; | ||
@@ -110,3 +110,3 @@ } | ||
// or if we have to await the callback first. | ||
setReactActEnvironment(previousActEnvironment); | ||
setIsReactActEnvironment(previousActEnvironment); | ||
throw error; | ||
@@ -113,0 +113,0 @@ } |
@@ -7,2 +7,4 @@ "use strict"; | ||
var _actCompat = require("./act-compat"); | ||
var _pure = require("./pure"); | ||
@@ -43,3 +45,18 @@ | ||
}); | ||
} // No test setup with other test runners available | ||
/* istanbul ignore else */ | ||
if (typeof beforeAll === 'function' && typeof afterAll === 'function') { | ||
// This matches the behavior of React < 18. | ||
let previousIsReactActEnvironment = (0, _actCompat.getIsReactActEnvironment)(); | ||
beforeAll(() => { | ||
previousIsReactActEnvironment = (0, _actCompat.getIsReactActEnvironment)(); | ||
(0, _actCompat.setReactActEnvironment)(true); | ||
}); | ||
afterAll(() => { | ||
(0, _actCompat.setReactActEnvironment)(previousIsReactActEnvironment); | ||
}); | ||
} | ||
} |
{ | ||
"name": "@testing-library/react", | ||
"version": "13.0.0-alpha.4", | ||
"version": "13.0.0-alpha.5", | ||
"description": "Simple and complete React DOM testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
4361198
29218