Skip to content

Commit 4a1b611

Browse files
committed
Fix Android 4 breadcrumbs tests
1 parent e0c7e05 commit 4a1b611

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

packages/browser/test/integration/init.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ Sentry.init({
4040
// return [new Sentry.Integrations.Debug({ stringify: true })].concat(old);
4141
// },
4242
beforeBreadcrumb: function(breadcrumb) {
43-
if (window.forceAllBreadcrumbs) {
44-
return breadcrumb;
45-
}
4643
// Filter console logs as we use them for debugging *a lot* and they are not *that* important
47-
if (breadcrumb.category === 'console') {
44+
// But allow then if we explicitly say so (for one of integration tests)
45+
if (breadcrumb.category === 'console' && !window.allowConsoleBreadcrumbs) {
4846
return null;
4947
}
5048

@@ -59,6 +57,11 @@ Sentry.init({
5957
return null;
6058
}
6159

60+
// Filter "refresh" like navigation which occurs in Mocha when testing on Android 4
61+
if (breadcrumb.category === 'navigation' && breadcrumb.data.from === breadcrumb.data.from) {
62+
return null;
63+
}
64+
6265
sentryBreadcrumbs.push(breadcrumb);
6366

6467
return breadcrumb;

packages/browser/test/integration/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ for (var idx in frames) {
13781378
iframe,
13791379
done,
13801380
function() {
1381-
window.forceAllBreadcrumbs = true;
1381+
window.allowConsoleBreadcrumbs = true;
13821382
var logs = document.createElement('script');
13831383
logs.src = 'console-logs.js';
13841384
logs.onload = function() {

0 commit comments

Comments
 (0)