@testing-library/react
Advanced tools
Comparing version 8.0.7 to 8.0.8
@@ -1,1 +0,3 @@ | ||
afterEach(require('./dist').cleanup) | ||
afterEach(() => { | ||
return require('./dist/cleanup-async')() | ||
}) |
@@ -17,6 +17,6 @@ "use strict"; | ||
var testUtils = _interopRequireWildcard(require("react-dom/test-utils")); | ||
var _reactDom2 = require("./react-dom-16.9.0-is-released"); | ||
var testUtils = _interopRequireWildcard(require("react-dom/test-utils")); | ||
const reactAct = testUtils.act; | ||
@@ -23,0 +23,0 @@ const actSupported = reactAct !== undefined; // act is supported react-dom@16.8.0 |
{ | ||
"name": "@testing-library/react", | ||
"version": "8.0.7", | ||
"version": "8.0.8", | ||
"description": "Simple and complete React DOM testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -32,3 +32,3 @@ <div align="center"> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-86-orange.svg?style=flat-square)](#contributors) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-89-orange.svg?style=flat-square)](#contributors) | ||
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] | ||
@@ -60,2 +60,3 @@ [![Join the community on Spectrum][spectrum-badge]][spectrum] | ||
- [Installation](#installation) | ||
- [Suppressing unnecessary warnings on React DOM 16.8](#suppressing-unnecessary-warnings-on-react-dom-168) | ||
- [Examples](#examples) | ||
@@ -113,2 +114,33 @@ - [Basic Example](#basic-example) | ||
### Suppressing unnecessary warnings on React DOM 16.8 | ||
There is a known compatibility issue with React DOM 16.8 where you will see the | ||
following warning: | ||
``` | ||
Warning: An update to ComponentName inside a test was not wrapped in act(...). | ||
``` | ||
If you cannot upgrade to React DOM 16.9, you may suppress the warnings by adding | ||
the following snippet to your test configuration | ||
([learn more](https://github.com/testing-library/react-testing-library/issues/281)): | ||
```js | ||
// this is just a little hack to silence a warning that we'll get until we | ||
// upgrade to 16.9: https://github.com/facebook/react/pull/14853 | ||
const originalError = console.error | ||
beforeAll(() => { | ||
console.error = (...args) => { | ||
if (/Warning.*not wrapped in act/.test(args[0])) { | ||
return | ||
} | ||
originalError.call(console, ...args) | ||
} | ||
}) | ||
afterAll(() => { | ||
console.error = originalError | ||
}) | ||
``` | ||
## Examples | ||
@@ -472,2 +504,5 @@ | ||
<td align="center"><a href="https://jeetiss.github.io/"><img src="https://avatars1.githubusercontent.com/u/6726016?v=4" width="100px;" alt="Ivakhnenko Dmitry"/><br /><sub><b>Ivakhnenko Dmitry</b></sub></a><br /><a href="https://github.com/testing-library/react-testing-library/commits?author=jeetiss" title="Code">💻</a></td> | ||
<td align="center"><a href="https://ghuser.io/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" width="100px;" alt="James George"/><br /><sub><b>James George</b></sub></a><br /><a href="https://github.com/testing-library/react-testing-library/commits?author=jamesgeorge007" title="Documentation">📖</a></td> | ||
<td align="center"><a href="https://joaofernandes.me/"><img src="https://avatars1.githubusercontent.com/u/1075053?v=4" width="100px;" alt="João Fernandes"/><br /><sub><b>João Fernandes</b></sub></a><br /><a href="https://github.com/testing-library/react-testing-library/commits?author=JSFernandes" title="Documentation">📖</a></td> | ||
<td align="center"><a href="https://github.com/alejandroperea"><img src="https://avatars3.githubusercontent.com/u/6084749?v=4" width="100px;" alt="Alejandro Perea"/><br /><sub><b>Alejandro Perea</b></sub></a><br /><a href="#review-alejandroperea" title="Reviewed Pull Requests">👀</a></td> | ||
</tr> | ||
@@ -483,3 +518,3 @@ </table> | ||
MIT | ||
[MIT](LICENSE) | ||
@@ -486,0 +521,0 @@ <!-- prettier-ignore-start --> |
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
1691823
16
11267
553