Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a test for the callback so I don't break it in the future

  • Loading branch information...
commit 1958579f72b0d9aca641125177ea5104fa1483b3 1 parent caf76c2
@mattrobenolt mattrobenolt authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/raven.client.js
View
20 test/raven.client.js
@@ -233,5 +233,25 @@ describe('raven.Client', function(){
client.patchGlobal();
process.emit('uncaughtException', new Error('derp'));
});
+
+ it('should trigger a callback after an uncaughtException', function(done){
+ var scope = nock('https://app.getsentry.com')
+ .filteringRequestBody(/.*/, '*')
+ .post('/api/store/', '*')
+ .reply(200, 'OK');
+
+ // remove existing uncaughtException handlers
+ var before = process._events.uncaughtException;
+ process.removeAllListeners('uncaughtException');
+
+ client.patchGlobal(function(){
+ // restore things to how they were
+ process._events.uncaughtException = before;
+
+ scope.done();
+ done();
+ });
+ process.emit('uncaughtException', new Error('derp'));
+ });
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.