Skip to content

Commit

Permalink
chore: update jest module mock scoping to mimic server environment in…
Browse files Browse the repository at this point in the history
… color-mode-provider tests
  • Loading branch information
Brennvo committed Oct 3, 2021
1 parent e1b2034 commit 2965e12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/color-mode/test/color-mode-provider__server.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ import {
} from "./utils"
import * as colorModeUtils from "../src/color-mode.utils"

jest.mock("@chakra-ui/utils", () => {
const actual = jest.requireActual("@chakra-ui/utils")

return {
...actual,
isBrowser: false,
}
})

beforeEach(() => {
jest.resetAllMocks()
mockIsBrowser(false)
})

describe("<ColorModeProvider /> localStorage server", () => {
Expand Down

0 comments on commit 2965e12

Please sign in to comment.