Skip to content

Commit 87df57a

Browse files
authored
Ensure 'process' is available before using
refs testing-library#413 refs testing-library#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 87df57a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)