Skip to content

Commit 905f4b3

Browse files
WestbrookKent C. Dodds
authored and
Kent C. Dodds
committed
fix: ensure 'process' is available before using (#431)
refs #413 refs #161 Not all environments (particularly the browser, where testing via tools like Karma occurs) have access to the `process` variable. There is already checking to ensure that its member properties have fallbacks, and this ensures that if it is simply unavailable the same fallback occurs.
1 parent a2c3472 commit 905f4b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/pretty-dom.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ const inNode = () =>
1616
process.versions.node !== undefined
1717

1818
const getMaxLength = dom =>
19-
inCypress(dom) ? 0 : process.env.DEBUG_PRINT_LIMIT || 7000
19+
inCypress(dom)
20+
? 0
21+
: typeof process !== 'undefined' && process.env.DEBUG_PRINT_LIMIT || 7000
2022

2123
const {DOMElement, DOMCollection} = prettyFormat.plugins
2224

0 commit comments

Comments
 (0)