Half of the time that I run my tests (npm test) I get the following stack trace and it's very misleading. Any idea how I could solve this?
/node_modules/raven/lib/client.js:217
kwargs.user = extend({}, this._globalContext.user, domainContext.user, kwargs.user);
^
TypeError: Cannot read property 'user' of undefined
at Raven.process (..node_modules/raven/lib/client.js:217:50)
at ..node_modules/raven/lib/client.js:375:12
at ..node_modules/raven/lib/parsers.js:55:5
at ..node_modules/raven/lib/utils.js:259:5
at ..node_modules/raven/lib/utils.js:169:35
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
After upgrading to @sentry/node things got much better and my tests have now been passing consistently.