Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 514159d

Browse files
committed
Kill deprecated stuff for v2.0
1 parent 8897993 commit 514159d

4 files changed

Lines changed: 7 additions & 93 deletions

File tree

index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
module.exports = require('./lib/client');
44
module.exports.utils = require('./lib/utils');
5-
module.exports.middleware = {
6-
connect: require('./lib/middleware/connect')
7-
};
8-
// friendly alias for "raven.middleware.express"
9-
module.exports.middleware.express = module.exports.middleware.connect;
5+
106
module.exports.transports = require('./lib/transports');
117
module.exports.parsers = require('./lib/parsers');
128

lib/client.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -509,35 +509,6 @@ extend(Raven.prototype, {
509509
}
510510
});
511511

512-
// Deprecations
513-
extend(Raven.prototype, {
514-
getIdent: function getIdent(result) {
515-
utils.consoleAlertOnce('getIdent has been deprecated and will be removed in v2.0');
516-
return result;
517-
},
518-
captureError: function captureError() {
519-
utils.consoleAlertOnce('captureError has been deprecated and will be removed in v2.0; use captureException instead');
520-
return this.captureException.apply(this, arguments);
521-
},
522-
captureQuery: function captureQuery() {
523-
utils.consoleAlertOnce('captureQuery has been deprecated and will be removed in v2.0');
524-
return this;
525-
},
526-
setUserContext: function setUserContext() {
527-
utils.consoleAlertOnce('setUserContext has been deprecated and will be removed in v2.0; use setContext instead');
528-
return this;
529-
},
530-
setExtraContext: function setExtraContext() {
531-
utils.consoleAlertOnce('setExtraContext has been deprecated and will be removed in v2.0; use setContext instead');
532-
return this;
533-
},
534-
setTagsContext: function setTagsContext() {
535-
utils.consoleAlertOnce('setTagsContext has been deprecated and will be removed in v2.0; use setContext instead');
536-
return this;
537-
},
538-
});
539-
Raven.prototype.get_ident = Raven.prototype.getIdent;
540-
541512
// Maintain old API compat, need to make sure arguments length is preserved
542513
function Client(dsn, options) {
543514
if (dsn instanceof Client) return dsn;

lib/middleware/connect.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

test/raven.client.js

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,6 @@ describe('raven.Client', function () {
145145
delete process.env.SENTRY_ENVIRONMENT;
146146
});
147147

148-
describe('#getIdent()', function () {
149-
it('should match', function () {
150-
var result = 'c988bf5cb7db4653825c92f6864e7206';
151-
client.getIdent(result).should.equal('c988bf5cb7db4653825c92f6864e7206');
152-
});
153-
});
154-
155148
describe('#captureMessage()', function () {
156149
it('should send a plain text message to Sentry server', function (done) {
157150
var scope = nock('https://app.getsentry.com')
@@ -208,7 +201,7 @@ describe('raven.Client', function () {
208201
});
209202
});
210203

211-
describe('#captureError()', function () {
204+
describe('#captureException()', function () {
212205
it('should send an Error to Sentry server', function (done) {
213206
var scope = nock('https://app.getsentry.com')
214207
.filteringRequestBody(/.*/, '*')
@@ -219,7 +212,7 @@ describe('raven.Client', function () {
219212
scope.done();
220213
done();
221214
});
222-
client.captureError(new Error('wtf?'));
215+
client.captureException(new Error('wtf?'));
223216
});
224217

225218
it('should send a plain text "error" with a synthesized stack', function (done) {
@@ -248,7 +241,7 @@ describe('raven.Client', function () {
248241
scope.done();
249242
done();
250243
});
251-
client.captureError(new Error('wtf?'));
244+
client.captureException(new Error('wtf?'));
252245
});
253246

254247
it('shouldn\'t choke on circular references', function (done) {
@@ -271,7 +264,7 @@ describe('raven.Client', function () {
271264
}
272265
};
273266
kwargs.extra.foo = kwargs;
274-
client.captureError(new Error('wtf?'), kwargs);
267+
client.captureException(new Error('wtf?'), kwargs);
275268
});
276269
});
277270

@@ -738,7 +731,7 @@ describe('raven.Client', function () {
738731
client.on('logged', function () {
739732
scope.done();
740733
});
741-
client.captureError(new Error('wtf?'));
734+
client.captureException(new Error('wtf?'));
742735
});
743736

744737
it('should capture extra data', function (done) {
@@ -1201,20 +1194,7 @@ describe('raven.Client', function () {
12011194
});
12021195
});
12031196

1204-
describe('raven.middleware', function () {
1205-
it('should use an instance passed to it instead of making a new one', function () {
1206-
var client = new raven.Client(dsn);
1207-
raven.middleware.express.getClient(client).should.equal(client);
1208-
});
1209-
1210-
it('should make a new instance when passed a DSN string', function () {
1211-
var client1 = new raven.Client(dsn);
1212-
var client2 = raven.middleware.express.getClient(dsn);
1213-
client2.should.not.equal(raven);
1214-
client2.should.not.equal(client1);
1215-
client2.should.be.an.instanceof(raven.constructor);
1216-
});
1217-
1197+
describe('raven requestHandler/errorHandler middleware', function () {
12181198
it('should explicitly add req and res to the domain', function (done) {
12191199
var client = new raven.Client(dsn).install();
12201200
var message = 'test breadcrumb';

0 commit comments

Comments
 (0)