Error when used with global document provided by jsdom #39
Open
Description
We are setting up a global document, as recommended by enzyme
to support some of our tests - using nyc
's require
configuration to load it before any of the tests start. Unfortunately, this causes tests errors to be reported as
ReferenceError: location is not defined
at Object.exports.stackTraceFilter ({project root}/node_modules/tap-mocha-reporter/lib/utils.js:651:9)
...
This happens because lib/utils.js
tests to see if it is in node or a browser by looking for a defined global document
.
is = typeof document === 'undefined'
? { node: true }
: { browser: true }
This is reasonable, but can lead to errors like the one we are experiencing where a global document
has been mocked.
Metadata
Assignees
Labels
No labels