You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I will submit a pull request that modifies the is.node|browser check to be based (additionally) off of process.release, to work around use cases like mine.
We are setting up a global document, as recommended by
enzyme
to support some of our tests - usingnyc
'srequire
configuration to load it before any of the tests start. Unfortunately, this causes tests errors to be reported asThis happens because
lib/utils.js
tests to see if it is in node or a browser by looking for a defined globaldocument
.This is reasonable, but can lead to errors like the one we are experiencing where a global
document
has been mocked.The text was updated successfully, but these errors were encountered: