       .reply(200, {"id": "c3115249083246efa839cfac2abbdefb"}) # mock sentry response with a random uuid
 
     @sentry.message 'message', '/path/to/logger'
-    scope.done()
 
   it 'emit logged event when successfully made an api call', (done) ->
-    scope = nock('https://app.getsentry.com')
+    @scope = nock('https://app.getsentry.com')
       .filteringRequestBody(/.*/, '*')
       .post("/api/#{sentry_settings.project_id}/store/", '*')
       .reply(200, 'OK')
 
-    @sentry.on 'logged', ->
-      scope.done()
-      done()
+    @sentry.on 'logged', -> done()
 
     @sentry.error new Error('wtf?'), "Unknown Error", "/"
 
   it 'emit error event when the api call returned an error', (done) ->
-    scope = nock('https://app.getsentry.com')
+    @scope = nock('https://app.getsentry.com')
       .filteringRequestBody(/.*/, '*')
       .post("/api/#{sentry_settings.project_id}/store/", '*')
       .reply(500, 'Oops!', {'x-sentry-error': 'Oops!'})
 
-    @sentry.once 'error', (err) ->
-      scope.done()
-      done()
+    @sentry.once 'error', (err) -> done()
 
     @sentry.message "hey!", "/"
 
   it 'one time listener should work correctly', (done) ->
     _sentry = new Sentry(sentry_settings)
 
-    scope = nock('https://app.getsentry.com')
+    @scope = nock('https://app.getsentry.com')
       .filteringRequestBody(/.*/, '*')
       .post("/api/#{sentry_settings.project_id}/store/", '*')
       .reply(500, 'Oops!', {'x-sentry-error': 'Oops!'})
 
-    _sentry.once 'error', ->
-      scope.done()
-      done()
+    _sentry.once 'error', -> done()
 
     _sentry.message "hey!", "/"
 

    assert.equal _sentry.disable_message, "Credentials you passed in aren't complete."

  it 'warns if passed an error that isnt an instance of Error', ->
    scope = nock('https://app.getsentry.com')
      .matchHeader('X-Sentry-Auth'
      , "Sentry sentry_version=4, sentry_key=#{sentry_settings.key}, sentry_secret=#{sentry_settings.secret}, sentry_client=sentry-node")
      .filteringRequestBody (path) ->

      .reply(200, {"id": "534f9b1b491241b28ee8d6b571e1999d"}) # mock sentry response with a random uuid

    @sentry.error new Error('Error message'), '/path/to/logger', 'culprit'

  it 'send error correctly when culprit not defined', ->
    @scope = nock('https://app.getsentry.com')
      .matchHeader('X-Sentry-Auth'
      , "Sentry sentry_version=4, sentry_key=#{sentry_settings.key}, sentry_secret=#{sentry_settings.secret}, sentry_client=sentry-node")
      .filteringRequestBody (path) ->
