From d04ca249ae005a7dbead0c4f660d0ad0d3013336 Mon Sep 17 00:00:00 2001 From: Ryan Newton Date: Wed, 6 Nov 2019 10:55:38 -0500 Subject: [PATCH] Add comment about 'cleanup' for react-testing-library --- docs/TutorialReact.md | 3 ++- .../react-testing-library/__tests__/CheckboxWithLabel-test.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/TutorialReact.md b/docs/TutorialReact.md index a66439e08eb8..511f4c544b53 100644 --- a/docs/TutorialReact.md +++ b/docs/TutorialReact.md @@ -256,7 +256,8 @@ import React from 'react'; import {cleanup, fireEvent, render} from '@testing-library/react'; import CheckboxWithLabel from '../CheckboxWithLabel'; -// automatically unmount and cleanup DOM after the test is finished. +// Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher +// unmount and cleanup DOM after the test is finished. afterEach(cleanup); it('CheckboxWithLabel changes the text after click', () => { diff --git a/examples/react-testing-library/__tests__/CheckboxWithLabel-test.js b/examples/react-testing-library/__tests__/CheckboxWithLabel-test.js index 8b3227003bb7..73aeeb99f4e6 100644 --- a/examples/react-testing-library/__tests__/CheckboxWithLabel-test.js +++ b/examples/react-testing-library/__tests__/CheckboxWithLabel-test.js @@ -4,7 +4,8 @@ import React from 'react'; import {cleanup, fireEvent, render} from '@testing-library/react'; import CheckboxWithLabel from '../CheckboxWithLabel'; -// automatically unmount and cleanup DOM after the test is finished. +// Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher +// unmount and cleanup DOM after the test is finished. afterEach(cleanup); it('CheckboxWithLabel changes the text after click', () => {