mirror of
https://github.com/danog/code-server.git
synced 2024-11-26 20:34:56 +01:00
refactor: update mocking logger in register test
This commit is contained in:
parent
cb4185b360
commit
e6a324b484
@ -1,6 +1,9 @@
|
||||
import { JSDOM } from "jsdom"
|
||||
import { loggerModule } from "./helpers"
|
||||
|
||||
// jest.mock is hoisted above the imports so we must use `require` here.
|
||||
jest.mock("@coder/logger", () => require("./helpers").loggerModule)
|
||||
|
||||
describe("register", () => {
|
||||
const { window } = new JSDOM()
|
||||
global.window = (window as unknown) as Window & typeof globalThis
|
||||
@ -18,10 +21,6 @@ describe("register", () => {
|
||||
})
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
jest.mock("@coder/logger", () => loggerModule)
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
mockRegisterFn.mockClear()
|
||||
jest.resetModules()
|
||||
|
Loading…
Reference in New Issue
Block a user