Skip to content

Commit cfe94af

Browse files
committed
Clean up grunt test terminal output ...
* Stop tests from attempting real XHRs * Remove extraneous console.log call
1 parent c6ed224 commit cfe94af

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/raven.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,9 @@ Raven.prototype = {
11671167
_makeRequest: function(opts) {
11681168
var request = new XMLHttpRequest();
11691169

1170+
if (request.send.toString() === 'function send() { [native code] }') {
1171+
throw new Error('shouldnt get here');
1172+
}
11701173
// if browser doesn't support CORS (e.g. IE7), we are out of luck
11711174
var hasCORS =
11721175
'withCredentials' in request ||

test/raven.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,7 @@ describe('Raven (public API)', function() {
19481948
});
19491949

19501950
it('should tag lastEventId #integration', function() {
1951+
this.sinon.stub(Raven, '_makeRequest');
19511952
setupRaven();
19521953
Raven.captureMessage('lol');
19531954
assert.equal(Raven.lastEventId(), 'abc123');
@@ -2125,6 +2126,8 @@ describe('Raven (public API)', function() {
21252126
});
21262127

21272128
it('should specify embed API endpoint and basic query string (DSN, eventId)', function () {
2129+
this.sinon.stub(Raven, '_makeRequest');
2130+
21282131
Raven.showReportDialog({
21292132
eventId: 'abc123',
21302133
dsn: SENTRY_DSN
@@ -2145,6 +2148,8 @@ describe('Raven (public API)', function() {
21452148
});
21462149

21472150
it('should specify embed API endpoint and full query string (DSN, eventId, user)', function () {
2151+
this.sinon.stub(Raven, '_makeRequest');
2152+
21482153
Raven.showReportDialog({
21492154
eventId: 'abc123',
21502155
dsn: SENTRY_DSN,

test/vendor/tracekit-parser.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ describe('TraceKit', function () {
126126
it('should parse Chrome error with blob URLs', function () {
127127
var stackFrames = TraceKit.computeStackTrace(CapturedExceptions.CHROME_48_BLOB);
128128
assert.ok(stackFrames);
129-
console.log(stackFrames);
130129
assert.deepEqual(stackFrames.stack.length, 7);
131130
assert.deepEqual(stackFrames.stack[1], { url: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', func: 's', args: [], line: 31, column: 29146, context: null });
132131
assert.deepEqual(stackFrames.stack[2], { url: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', func: 'Object.d [as add]', args: [ ], line: 31, column: 30039, context: null });

0 commit comments

Comments
 (0)