Skip to content

Commit 2c83520

Browse files
authored
Add Breadcrumbs tests.
1 parent 3fada88 commit 2c83520

File tree

3 files changed

+559
-14
lines changed

3 files changed

+559
-14
lines changed

packages/browser/test/e2e/index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
<!DOCTYPE html>
2-
<html lang="en" dir="ltr">
2+
<html>
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7-
<title>Sample Webpack App</title>
5+
<title></title>
6+
<script src="bundle.js"></script>
87
</head>
98
<body>
109
<!-- For Breadcrumbs Tests -->
1110
<form id="foo-form">
1211
<input name="foo" placeholder="lol" />
1312
<div class="contenteditable" contenteditable="true"></div>
1413
</form>
15-
<script src="bundle.js"></script>
14+
15+
<div class="c">
16+
<div class="b">
17+
<div class="a"></div>
18+
</div>
19+
</div>
1620
</body>
1721
</html>
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
const Sentry = require('@sentry/browser');
2-
2+
const { normalize } = require('@sentry/utils');
33
window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
integrations: [new Sentry.Integrations.Dedupe()],
8+
attachStacktrace: true,
9+
denyUrls: ['foo.js'],
10+
beforeBreadcrumb: function(breadcrumb, breadcrumbHint) {
11+
// Remove circular properties from event target
12+
// Store `breadcrumbHint` inside `breadcrumb` for tests
13+
if (breadcrumbHint) {
14+
breadcrumb.hint = normalize(breadcrumbHint);
15+
}
16+
17+
return breadcrumb;
18+
},
719
});

0 commit comments

Comments
 (0)