From a5303564b11b4ca59e73cdfb0dc54568444d549b Mon Sep 17 00:00:00 2001 From: Anyul Rivas Date: Tue, 10 Nov 2020 10:46:31 +0100 Subject: [PATCH 1/2] Adding Testing library as a library requiring jsdom As the *React Testing library* requires a dom to execute their assertions, I'm adding it to the list of libraries requiring it on the documentation. --- docusaurus/docs/running-tests.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index ccc3fecd9a1..04ed271cc06 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -321,6 +321,7 @@ To help you make up your mind, here is a list of APIs that **need jsdom**: - [`ReactDOM.render()`](https://facebook.github.io/react/docs/top-level-api.html#reactdom.render) - [`TestUtils.renderIntoDocument()`](https://facebook.github.io/react/docs/test-utils.html#renderintodocument) ([a shortcut](https://github.com/facebook/react/blob/34761cf9a252964abfaab6faf74d473ad95d1f21/src/test/ReactTestUtils.js#L83-L91) for the above) - [`mount()`](https://airbnb.io/enzyme/docs/api/mount.html) in [Enzyme](https://airbnb.io/enzyme/index.html) +- [`render`](https://testing-library.com/docs/react-testing-library/api/#render) in [Testing Library](https://testing-library.com/) In contrast, **jsdom is not needed** for the following APIs: From 91a3c9363c17ff70e787bd62d79fa9fe0a43237a Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Tue, 10 Nov 2020 08:47:58 -0800 Subject: [PATCH 2/2] Update running-tests.md --- docusaurus/docs/running-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index 04ed271cc06..ffbb0f70a74 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -321,7 +321,7 @@ To help you make up your mind, here is a list of APIs that **need jsdom**: - [`ReactDOM.render()`](https://facebook.github.io/react/docs/top-level-api.html#reactdom.render) - [`TestUtils.renderIntoDocument()`](https://facebook.github.io/react/docs/test-utils.html#renderintodocument) ([a shortcut](https://github.com/facebook/react/blob/34761cf9a252964abfaab6faf74d473ad95d1f21/src/test/ReactTestUtils.js#L83-L91) for the above) - [`mount()`](https://airbnb.io/enzyme/docs/api/mount.html) in [Enzyme](https://airbnb.io/enzyme/index.html) -- [`render`](https://testing-library.com/docs/react-testing-library/api/#render) in [Testing Library](https://testing-library.com/) +- [`render()`](https://testing-library.com/docs/react-testing-library/api/#render) in [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) In contrast, **jsdom is not needed** for the following APIs: