You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dev-packages/browser-integration-tests/suites/manual-client/skip-init-browser-extension/test.ts
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
import{expect}from'@playwright/test';
2
2
import{sentryTest}from'../../../utils/fixtures';
3
+
import{hasDebugLogs}from'../../../utils/helpers';
3
4
4
5
sentryTest(
5
6
'should not initialize when inside a Firefox/Safari browser extension',
@@ -18,9 +19,14 @@ sentryTest(
18
19
});
19
20
20
21
expect(isInitialized).toEqual(false);
21
-
expect(errorLogs.length).toEqual(1);
22
-
expect(errorLogs[0]).toEqual(
23
-
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
24
-
);
22
+
23
+
if(hasDebugLogs()){
24
+
expect(errorLogs.length).toEqual(1);
25
+
expect(errorLogs[0]).toEqual(
26
+
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
Copy file name to clipboardExpand all lines: dev-packages/browser-integration-tests/suites/manual-client/skip-init-chrome-extension/test.ts
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
import{expect}from'@playwright/test';
2
2
import{sentryTest}from'../../../utils/fixtures';
3
+
import{hasDebugLogs}from'../../../utils/helpers';
3
4
4
5
sentryTest('should not initialize when inside a Chrome browser extension',async({ getLocalTestUrl, page })=>{
5
6
consterrorLogs: string[]=[];
@@ -16,8 +17,13 @@ sentryTest('should not initialize when inside a Chrome browser extension', async
16
17
});
17
18
18
19
expect(isInitialized).toEqual(false);
19
-
expect(errorLogs.length).toEqual(1);
20
-
expect(errorLogs[0]).toEqual(
21
-
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
22
-
);
20
+
21
+
if(hasDebugLogs()){
22
+
expect(errorLogs.length).toEqual(1);
23
+
expect(errorLogs[0]).toEqual(
24
+
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
180
-
);
181
-
});
176
+
if(DEBUG_BUILD){
177
+
consoleSandbox(()=>{
178
+
// eslint-disable-next-line no-console
179
+
console.error(
180
+
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
181
+
);
182
+
});
183
+
}
182
184
return;
183
185
}
184
186
185
-
if(DEBUG_BUILD){
186
-
if(!supportsFetch()){
187
-
logger.warn(
188
-
'No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.',
189
-
);
190
-
}
187
+
if(DEBUG_BUILD&&!supportsFetch()){
188
+
logger.warn(
189
+
'No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.',
0 commit comments