Skip to content

Commit 2accab9

Browse files
committed
autoformat browser integration tests
1 parent ba16861 commit 2accab9

24 files changed

+1216
-1693
lines changed

packages/browser/test/integration/browsers.js

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,83 +3,83 @@
33

44
module.exports = {
55
bs_android_4: {
6-
base: "BrowserStack",
7-
browser: "Android Browser",
8-
device: "Samsung Galaxy Note 4",
9-
os: "android",
10-
os_version: "4.4",
6+
base: 'BrowserStack',
7+
browser: 'Android Browser',
8+
device: 'Samsung Galaxy Note 4',
9+
os: 'android',
10+
os_version: '4.4',
1111
real_mobile: true,
1212
browser_version: null,
1313
},
1414
bs_android_5: {
15-
base: "BrowserStack",
16-
browser: "Android Browser",
17-
device: "Samsung Galaxy S6",
18-
os: "android",
19-
os_version: "5.0",
15+
base: 'BrowserStack',
16+
browser: 'Android Browser',
17+
device: 'Samsung Galaxy S6',
18+
os: 'android',
19+
os_version: '5.0',
2020
real_mobile: true,
2121
browser_version: null,
2222
},
2323
bs_android_6: {
24-
base: "BrowserStack",
25-
browser: "Android Browser",
26-
device: "Google Nexus 6",
27-
os: "android",
28-
os_version: "6.0",
24+
base: 'BrowserStack',
25+
browser: 'Android Browser',
26+
device: 'Google Nexus 6',
27+
os: 'android',
28+
os_version: '6.0',
2929
real_mobile: true,
3030
browser_version: null,
3131
},
3232
bs_android_7: {
33-
base: "BrowserStack",
34-
browser: "Android Browser",
35-
device: "Samsung Galaxy Note 8",
36-
os: "android",
37-
os_version: "7.1",
33+
base: 'BrowserStack',
34+
browser: 'Android Browser',
35+
device: 'Samsung Galaxy Note 8',
36+
os: 'android',
37+
os_version: '7.1',
3838
real_mobile: true,
3939
browser_version: null,
4040
},
4141
bs_android_8: {
42-
base: "BrowserStack",
43-
browser: "Android Browser",
44-
device: "Samsung Galaxy Note 9",
45-
os: "android",
46-
os_version: "8.1",
42+
base: 'BrowserStack',
43+
browser: 'Android Browser',
44+
device: 'Samsung Galaxy Note 9',
45+
os: 'android',
46+
os_version: '8.1',
4747
real_mobile: true,
4848
browser_version: null,
4949
},
5050
bs_android_9: {
51-
base: "BrowserStack",
52-
browser: "Android Browser",
53-
device: "Samsung Galaxy Note 10 Plus",
54-
os: "android",
55-
os_version: "9.0",
51+
base: 'BrowserStack',
52+
browser: 'Android Browser',
53+
device: 'Samsung Galaxy Note 10 Plus',
54+
os: 'android',
55+
os_version: '9.0',
5656
real_mobile: true,
5757
browser_version: null,
5858
},
5959
bs_android_10: {
60-
base: "BrowserStack",
61-
browser: "Android Browser",
62-
device: "Google Pixel 4 XL",
63-
os: "android",
64-
os_version: "10.0",
60+
base: 'BrowserStack',
61+
browser: 'Android Browser',
62+
device: 'Google Pixel 4 XL',
63+
os: 'android',
64+
os_version: '10.0',
6565
real_mobile: true,
6666
browser_version: null,
6767
},
6868
bs_ios_12: {
69-
base: "BrowserStack",
70-
browser: "Mobile Safari",
71-
device: "iPhone XS",
72-
os: "ios",
73-
os_version: "12",
69+
base: 'BrowserStack',
70+
browser: 'Mobile Safari',
71+
device: 'iPhone XS',
72+
os: 'ios',
73+
os_version: '12',
7474
real_mobile: true,
7575
browser_version: null,
7676
},
7777
bs_ios_13: {
78-
base: "BrowserStack",
79-
browser: "Mobile Safari",
80-
device: "iPhone 11",
81-
os: "ios",
82-
os_version: "13",
78+
base: 'BrowserStack',
79+
browser: 'Mobile Safari',
80+
device: 'iPhone 11',
81+
os: 'ios',
82+
os_version: '13',
8383
real_mobile: true,
8484
browser_version: null,
8585
},
@@ -94,47 +94,47 @@ module.exports = {
9494
// real_mobile: null,
9595
// },
9696
bs_ie11: {
97-
base: "BrowserStack",
98-
browser: "IE",
99-
browser_version: "11.0",
100-
os: "Windows",
101-
os_version: "10",
97+
base: 'BrowserStack',
98+
browser: 'IE',
99+
browser_version: '11.0',
100+
os: 'Windows',
101+
os_version: '10',
102102
device: null,
103103
real_mobile: null,
104104
},
105105
bs_safari: {
106-
base: "BrowserStack",
107-
browser: "Safari",
108-
browser_version: "latest",
109-
os: "OS X",
110-
os_version: "Catalina",
106+
base: 'BrowserStack',
107+
browser: 'Safari',
108+
browser_version: 'latest',
109+
os: 'OS X',
110+
os_version: 'Catalina',
111111
device: null,
112112
real_mobile: null,
113113
},
114114
bs_edge: {
115-
base: "BrowserStack",
116-
browser: "Edge",
117-
browser_version: "latest",
118-
os: "Windows",
119-
os_version: "10",
115+
base: 'BrowserStack',
116+
browser: 'Edge',
117+
browser_version: 'latest',
118+
os: 'Windows',
119+
os_version: '10',
120120
device: null,
121121
real_mobile: null,
122122
},
123123
bs_firefox: {
124-
base: "BrowserStack",
125-
browser: "Firefox",
126-
browser_version: "latest",
127-
os: "Windows",
128-
os_version: "10",
124+
base: 'BrowserStack',
125+
browser: 'Firefox',
126+
browser_version: 'latest',
127+
os: 'Windows',
128+
os_version: '10',
129129
device: null,
130130
real_mobile: null,
131131
},
132132
bs_chrome: {
133-
base: "BrowserStack",
134-
browser: "Chrome",
135-
browser_version: "latest",
136-
os: "Windows",
137-
os_version: "10",
133+
base: 'BrowserStack',
134+
browser: 'Chrome',
135+
browser_version: 'latest',
136+
os: 'Windows',
137+
os_version: '10',
138138
device: null,
139139
real_mobile: null,
140140
},

packages/browser/test/integration/common/init.js

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,44 @@ var breadcrumbHints = [];
1414
// Oh dear IE10...
1515
var dsn =
1616
document.location.protocol +
17-
"//public@" +
17+
'//public@' +
1818
document.location.hostname +
19-
(document.location.port ? ":" + document.location.port : "") +
20-
"/1";
19+
(document.location.port ? ':' + document.location.port : '') +
20+
'/1';
2121

2222
function initSDK() {
2323
Sentry.init({
2424
dsn: dsn,
2525
integrations: [new Sentry.Integrations.Dedupe()],
2626
attachStacktrace: true,
27-
ignoreErrors: ["ignoreErrorTest"],
28-
denyUrls: ["foo.js"],
29-
beforeSend: function(event, eventHint) {
27+
ignoreErrors: ['ignoreErrorTest'],
28+
denyUrls: ['foo.js'],
29+
beforeSend: function (event, eventHint) {
3030
events.push(event);
3131
eventHints.push(eventHint);
3232
return event;
3333
},
34-
beforeBreadcrumb: function(breadcrumb, breadcrumbHint) {
34+
beforeBreadcrumb: function (breadcrumb, breadcrumbHint) {
3535
// Filter console logs as we use them for debugging *a lot* and they are not *that* important
3636
// But allow then if we explicitly say so (for one of integration tests)
37-
if (
38-
breadcrumb.category === "console" &&
39-
!window.allowConsoleBreadcrumbs
40-
) {
37+
if (breadcrumb.category === 'console' && !window.allowConsoleBreadcrumbs) {
4138
return null;
4239
}
4340

4441
// One of the tests use manually created breadcrumb without eventId and we want to let it through
45-
if (
46-
breadcrumb.category.indexOf("sentry") === 0 &&
47-
breadcrumb.event_id &&
48-
!window.allowSentryBreadcrumbs
49-
) {
42+
if (breadcrumb.category.indexOf('sentry') === 0 && breadcrumb.event_id && !window.allowSentryBreadcrumbs) {
5043
return null;
5144
}
5245

5346
if (
54-
breadcrumb.type === "http" &&
55-
(breadcrumb.data.url.indexOf("test.js") !== -1 ||
56-
breadcrumb.data.url.indexOf("frame.html") !== -1)
47+
breadcrumb.type === 'http' &&
48+
(breadcrumb.data.url.indexOf('test.js') !== -1 || breadcrumb.data.url.indexOf('frame.html') !== -1)
5749
) {
5850
return null;
5951
}
6052

6153
// Filter "refresh" like navigation which occurs in Mocha when testing on Android 4
62-
if (
63-
breadcrumb.category === "navigation" &&
64-
breadcrumb.data.to === breadcrumb.data.from
65-
) {
54+
if (breadcrumb.category === 'navigation' && breadcrumb.data.to === breadcrumb.data.from) {
6655
return null;
6756
}
6857

packages/browser/test/integration/common/triggers.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ function foo2() {
1616

1717
function throwNonError() {
1818
try {
19-
throw { foo: "bar" };
19+
throw { foo: 'bar' };
2020
} catch (o_O) {
2121
Sentry.captureException(o_O);
2222
}
2323
}
2424

2525
function throwError(message) {
2626
// eslint-disable-next-line no-param-reassign
27-
message = message || "foo";
27+
message = message || 'foo';
2828
try {
2929
throw new Error(message);
3030
} catch (o_O) {
@@ -34,7 +34,7 @@ function throwError(message) {
3434

3535
function throwRandomError() {
3636
try {
37-
throw new Error("Exception no " + (Date.now() + Math.random()));
37+
throw new Error('Exception no ' + (Date.now() + Math.random()));
3838
} catch (o_O) {
3939
Sentry.captureException(o_O);
4040
}
@@ -47,12 +47,12 @@ function throwSameConsecutiveErrors(message) {
4747

4848
function captureMessage(message) {
4949
// eslint-disable-next-line no-param-reassign
50-
message = message || "message";
50+
message = message || 'message';
5151
Sentry.captureMessage(message);
5252
}
5353

5454
function captureRandomMessage() {
55-
Sentry.captureMessage("Message no " + (Date.now() + Math.random()));
55+
Sentry.captureMessage('Message no ' + (Date.now() + Math.random()));
5656
}
5757

5858
function captureSameConsecutiveMessages(message) {

packages/browser/test/integration/common/utils.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// All the functions below can be called within the iframe under the test
22

33
function supportsFetch() {
4-
if (!("fetch" in window)) {
4+
if (!('fetch' in window)) {
55
return false;
66
}
77

88
try {
99
new Headers();
10-
new Request("");
10+
new Request('');
1111
new Response();
1212
return true;
1313
} catch (e) {
@@ -21,12 +21,12 @@ function supportsNativeFetch() {
2121
}
2222

2323
function isNativeFunc(func) {
24-
return func.toString().indexOf("native") !== -1;
24+
return func.toString().indexOf('native') !== -1;
2525
}
2626

2727
var result = null;
2828
if (window.document) {
29-
var sandbox = window.document.createElement("iframe");
29+
var sandbox = window.document.createElement('iframe');
3030
sandbox.hidden = true;
3131
try {
3232
window.document.head.appendChild(sandbox);
@@ -46,7 +46,7 @@ function supportsNativeFetch() {
4646
}
4747

4848
function supportsOnunhandledRejection() {
49-
return typeof PromiseRejectionEvent !== "undefined";
49+
return typeof PromiseRejectionEvent !== 'undefined';
5050
}
5151

5252
function isBelowIE11() {
@@ -58,7 +58,7 @@ function isBelowIE11() {
5858
// (╯°□°)╯︵ ┻━┻
5959
function canReadFunctionName() {
6060
function foo() {}
61-
if (foo.name === "foo") return true;
61+
if (foo.name === 'foo') return true;
6262
return false;
6363
}
6464

@@ -67,7 +67,7 @@ function waitForXHR(xhr, cb) {
6767
return cb();
6868
}
6969

70-
setTimeout(function() {
70+
setTimeout(function () {
7171
waitForXHR(xhr, cb);
7272
}, 1000 / 60);
7373
}

0 commit comments

Comments
 (0)