Skip to content

Commit

Permalink
fix: remove document from isBrowser fn
Browse files Browse the repository at this point in the history
  • Loading branch information
panvourtsis authored Nov 9, 2023
1 parent 59de60e commit bf5e7d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/jest/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow

const isBrowser = document => typeof document !== 'undefined'
const isBrowser = () => typeof document !== 'undefined'

function last(arr) {
return arr.length > 0 ? arr[arr.length - 1] : undefined
Expand Down Expand Up @@ -260,7 +260,7 @@ export function getStylesFromClassNames(
}

export function getStyleElements(): Array<HTMLStyleElement> {
if (!isBrowser(document)) {
if (!isBrowser()) {
throw new Error(
'jest-emotion requires jsdom. See https://jestjs.io/docs/en/configuration#testenvironment-string for more information.'
)
Expand Down

0 comments on commit bf5e7d0

Please sign in to comment.