Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59bac76

Browse files
committed
Fix: tests
1 parent eb65490 commit 59bac76

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

site/jest.setup.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ beforeAll(() =>
99

1010
// Reset any request handlers that we may add during the tests,
1111
// so they don't affect other tests.
12-
afterEach(() => server.resetHandlers())
12+
afterEach(() => {
13+
server.resetHandlers()
14+
jest.clearAllMocks()
15+
})
1316

1417
// Clean up after the tests are finished.
1518
afterAll(() => server.close())

site/src/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios, { AxiosRequestHeaders } from "axios"
22
import { mutate } from "swr"
3-
import { MockPager, MockUser, MockUser2 } from "../test_helpers"
3+
import { MockPager, MockUser, MockUser2 } from "../test_helpers/entities"
44
import * as Types from "./types"
55

66
const CONTENT_TYPE_JSON: AxiosRequestHeaders = {

site/src/pages/preferences/account.test.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ const fillAndSubmitForm = async () => {
3131
}
3232

3333
describe("PreferencesAccountPage", () => {
34-
afterEach(() => {
35-
jest.clearAllMocks()
36-
})
37-
3834
describe("when it is a success", () => {
3935
it("shows the success message", async () => {
4036
jest.spyOn(API, "updateProfile").mockImplementationOnce((userId, data) =>

0 commit comments

Comments
 (0)