Skip to content

Commit a3ef256

Browse files
aryaemami59markerikson
authored andcommitted
Remove unnecessary rtl.cleanup calls
- According to `@testing-library/react` docs, the `cleanup` function is called automatically during the `afterEach` hook and there is no need to manually call it.
1 parent 8f9ec75 commit a3ef256

File tree

4 files changed

+0
-8
lines changed

4 files changed

+0
-8
lines changed

test/components/Provider.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ const createExampleTextReducer =
1515

1616
describe('React', () => {
1717
describe('Provider', () => {
18-
afterEach(() => rtl.cleanup())
19-
2018
const createChild = (storeKey = 'store') => {
2119
class Child extends Component {
2220
render() {

test/components/connect.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ describe('React', () => {
8282
return action.type === 'APPEND' ? prev + action.body : prev
8383
}
8484

85-
afterEach(() => rtl.cleanup())
86-
8785
describe('Core subscription and prop passing behavior', () => {
8886
it('should receive the store state in the context', () => {
8987
const store = createStore(() => ({ hi: 'there' }))

test/components/hooks.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ const IS_REACT_18 = React.version.startsWith('18')
1010

1111
describe('React', () => {
1212
describe('connect', () => {
13-
afterEach(() => rtl.cleanup())
14-
1513
it('should render on useEffect hook state update', () => {
1614
interface RootStateType {
1715
byId: {

test/hooks/useSelector.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ describe('React', () => {
6868
renderedItems = []
6969
})
7070

71-
afterEach(() => rtl.cleanup())
72-
7371
describe('core subscription behavior', () => {
7472
it('selects the state on initial render', () => {
7573
let result: number | undefined

0 commit comments

Comments
 (0)