diff --git a/lib/client.js b/lib/client.js index f1ffe02..dc6ad4b 100644 --- a/lib/client.js +++ b/lib/client.js @@ -148,7 +148,6 @@ extend(Raven.prototype, { eventId = this.generateEventId(); } - var domainContext = domain.active && domain.active.sentryContext || {}; kwargs.user = extend({}, this._globalContext.user, domainContext.user, kwargs.user); kwargs.tags = extend({}, this._globalContext.tags, domainContext.tags, kwargs.tags); diff --git a/package.json b/package.json index fed0647..3985647 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "scripts": { "pretest": "npm install && npm run lint", "test": "NODE_ENV=test istanbul cover _mocha -- --reporter dot && NODE_ENV=test node_modules/coffee-script/bin/coffee ./test/run.coffee", + "test-mocha": "NODE_ENV=test mocha", "test-full": "npm run test && cd test/instrumentation && ./run.sh", "lint": "node_modules/eslint/bin/eslint.js ." }, diff --git a/test/raven.client.js b/test/raven.client.js index d901023..9471801 100644 --- a/test/raven.client.js +++ b/test/raven.client.js @@ -918,9 +918,26 @@ describe('raven.Client', function () { category: 'test', message: message }); + client.getContext().should.not.equal(client._globalContext); client.getContext().breadcrumbs[0].message.should.equal(message); - done(); }); + done(); + }); + + it('should capture breadcrumbs at global context level', function (done) { + var message = 'test breadcrumb'; + client = new raven.Client(dsn, { + shouldSendCallback: function (data) { + data.breadcrumbs.values.length.should.equal(1); + done(); + } + }); + client.install(); + client.captureBreadcrumb({ + category: 'test', + message: message + }); + client.captureException(new Error('oh no')); }); it('should instrument console to capture breadcrumbs', function (done) {