Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"grunt-contrib-uglify": "^0.11.0",
"grunt-eslint": "^17.3.1",
"grunt-gitinfo": "^0.1.7",
"grunt-mocha": "^0.4.15",
"grunt-mocha": "1.0.2",
"grunt-release": "^0.13.0",
"grunt-s3": "0.2.0-alpha.3",
"grunt-sri": "mattrobenolt/grunt-sri#pretty",
Expand Down
28 changes: 10 additions & 18 deletions test/integration/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,30 +414,22 @@ describe('integration', function () {
);
});

it('should NOT capture breadcrumbs from XMLHttpRequests to the Sentry store endpoint', function (done) {
it('should NOT denote XMLHttpRequests to the Sentry store endpoint as requiring breadcrumb capture', function (done) {
Copy link
Contributor Author

@benvinegar benvinegar Nov 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to change this test because Phantom 2 throws a network error that DOES get collected as a (error) breadcrumb. Better that this test not attempt to make an XHR at all.

var iframe = this.iframe;
iframeExecute(iframe, done,
function () {
// some browsers trigger onpopstate for load / reset breadcrumb state
Raven._breadcrumbs = [];

var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://example.com/api/1/store/?sentry_key=public');
xhr.setRequestHeader('Content-type', 'application/json');
xhr.onreadystatechange = function () {
// don't fire `done` handler until at least *one* onreadystatechange
// has occurred (doesn't actually need to finish)
if (xhr.readyState === 4) {
setTimeout(done);
}
};
xhr.send();
xhr.open('GET', 'http://example.com/api/1/store/?sentry_key=public');

// can't actually transmit an XHR (breadcrumb isnt recorded until
// onreadystatechange fires), so enough to just verify that
// __raven_xhr wasn't set on xhr object

window.ravenData = xhr.hasOwnProperty('__raven_xhr');
setTimeout(done);
},
function () {
var Raven = iframe.contentWindow.Raven,
breadcrumbs = Raven._breadcrumbs;

assert.equal(breadcrumbs.length, 0);
assert.isFalse(iframe.contentWindow.ravenData);
}
);
});
Expand Down