Skip to content

Commit

Permalink
remove unused manual cleanups from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed Sep 20, 2024
1 parent 0ecb48e commit f8cd48b
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 28 deletions.
3 changes: 1 addition & 2 deletions src/layouts/BaseLayout/BaseLayout.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen, waitFor } from '@testing-library/react'
import { render, screen, waitFor } from '@testing-library/react'
import { graphql, http, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
import { MemoryRouter, Route, useLocation } from 'react-router-dom'
Expand Down Expand Up @@ -193,7 +193,6 @@ afterEach(() => {
queryClient.clear()
server.resetHandlers()
vi.clearAllMocks()
cleanup()
})

afterAll(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen, waitFor } from '@testing-library/react'
import { render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { graphql, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
Expand All @@ -19,7 +19,6 @@ beforeAll(() => {
})

beforeEach(() => {
cleanup()
queryClient.clear()
server.resetHandlers()
})
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/BaseLayout/hooks/useUserAccessGate.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, renderHook, waitFor } from '@testing-library/react'
import { renderHook, waitFor } from '@testing-library/react'
import { delay, graphql, http, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
import { MemoryRouter, Route } from 'react-router-dom'
Expand Down Expand Up @@ -221,7 +221,6 @@ beforeAll(() => {
})

beforeEach(() => {
cleanup()
queryClient.clear()
server.resetHandlers()
})
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/Header/Header.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import { graphql, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
import { MemoryRouter, Route } from 'react-router-dom'
Expand Down Expand Up @@ -93,7 +93,6 @@ beforeAll(() => {
})

afterEach(() => {
cleanup()
server.resetHandlers()
queryClient.clear()
})
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/Header/components/AdminLink/AdminLink.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import { http, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
import { MemoryRouter, Route } from 'react-router-dom'
Expand Down Expand Up @@ -32,7 +32,6 @@ beforeAll(() => {
})

beforeEach(() => {
cleanup()
server.resetHandlers()
queryClient.clear()
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import React from 'react'
import { MemoryRouter, Route } from 'react-router-dom'
import { type Mock } from 'vitest'
Expand Down Expand Up @@ -40,7 +40,6 @@ beforeEach(() => {
})

afterEach(() => {
cleanup()
queryClient.clear()
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen, waitFor } from '@testing-library/react'
import { render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { graphql, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
Expand Down Expand Up @@ -59,7 +59,6 @@ beforeAll(() => {
})

afterEach(() => {
cleanup()
queryClient.clear()
server.restoreHandlers()
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import { graphql, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
import { MemoryRouter, Route } from 'react-router-dom'
Expand Down Expand Up @@ -43,7 +43,6 @@ beforeAll(() => {
})

afterEach(() => {
cleanup()
server.resetHandlers()
queryClient.clear()
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import * as Sentry from '@sentry/react'
import {
cleanup,
render,
screen,
waitFor,
within,
} from '@testing-library/react'
import { render, screen, waitFor, within } from '@testing-library/react'
import userEvent from '@testing-library/user-event'

import { ThemeContextProvider } from 'shared/ThemeContext'
Expand Down Expand Up @@ -33,7 +27,6 @@ describe('ThemeToggle', () => {
})

afterEach(() => {
cleanup()
vi.clearAllMocks()
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen, waitFor } from '@testing-library/react'
import { render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { graphql, http, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
Expand Down Expand Up @@ -92,7 +92,6 @@ beforeAll(() => {
})

afterEach(() => {
cleanup()
queryClient.clear()
server.resetHandlers()
})
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/LoginLayout/LoginLayout.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { cleanup, render, screen, waitFor } from '@testing-library/react'
import { render, screen, waitFor } from '@testing-library/react'
import { graphql, HttpResponse } from 'msw2'
import { setupServer } from 'msw2/node'
import { MemoryRouter, Route } from 'react-router-dom'
Expand Down Expand Up @@ -44,7 +44,6 @@ beforeAll(() => {
afterEach(() => {
queryClient.clear()
server.resetHandlers()
cleanup()
vi.clearAllMocks()
})

Expand Down

0 comments on commit f8cd48b

Please sign in to comment.