Skip to content

Commit bba3ece

Browse files
committed
adjust browser integration test
1 parent d6c43c2 commit bba3ece

File tree

2 files changed

+10
-14
lines changed
  • dev-packages/browser-integration-tests/suites/public-api/logger/scopeAttributes

2 files changed

+10
-14
lines changed

dev-packages/browser-integration-tests/suites/public-api/logger/scopeAttributes/subject.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
// only log attribute
2-
Sentry.logger.info('log_before_any_scope', { log_attr: 'scope_attr_1' });
2+
Sentry.logger.info('log_before_any_scope', { log_attr: 'log_attr_1' });
33

44
Sentry.getGlobalScope().setAttribute('global_scope_attr', true);
55

66
// global scope, log attribute
7-
Sentry.logger.info('log_after_global_scope', { log_attr: 'scope_attr_2' });
8-
9-
let isolScope = null;
10-
let isolScope2 = null;
7+
Sentry.logger.info('log_after_global_scope', { log_attr: 'log_attr_2' });
118

129
Sentry.withIsolationScope(isolationScope => {
13-
isolScope = isolationScope;
1410
isolationScope.setAttribute('isolation_scope_1_attr', { value: 100, unit: 'ms' });
1511

1612
// global scope, isolation scope, log attribute
17-
Sentry.logger.info('log_with_isolation_scope', { log_attr: 'scope_attr_3' });
13+
Sentry.logger.info('log_with_isolation_scope', { log_attr: 'log_attr_3' });
1814

1915
Sentry.withScope(scope => {
2016
scope.setAttribute('scope_attr', { value: 200, unit: 'ms' });
2117

2218
// global scope, isolation scope, current scope attribute, log attribute
23-
Sentry.logger.info('log_with_scope', { log_attr: 'scope_attr_4' });
19+
Sentry.logger.info('log_with_scope', { log_attr: 'log_attr_4' });
2420
});
2521

2622
Sentry.withScope(scope2 => {
2723
scope2.setAttribute('scope_2_attr', { value: 300, unit: 'ms' });
2824

2925
// global scope, isolation scope, current scope attribute, log attribute
30-
Sentry.logger.info('log_with_scope_2', { log_attr: 'scope_attr_5' });
26+
Sentry.logger.info('log_with_scope_2', { log_attr: 'log_attr_5' });
3127
});
3228
});
3329

dev-packages/browser-integration-tests/suites/public-api/logger/scopeAttributes/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page
3232
attributes: {
3333
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
3434
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
35-
log_attr: { value: 'scope_attr_1', type: 'string' },
35+
log_attr: { value: 'log_attr_1', type: 'string' },
3636
},
3737
},
3838
{
@@ -45,7 +45,7 @@ sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page
4545
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
4646
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
4747
global_scope_attr: { value: true, type: 'boolean' },
48-
log_attr: { value: 'scope_attr_2', type: 'string' },
48+
log_attr: { value: 'log_attr_2', type: 'string' },
4949
},
5050
},
5151
{
@@ -59,7 +59,7 @@ sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page
5959
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
6060
global_scope_attr: { value: true, type: 'boolean' },
6161
isolation_scope_1_attr: { value: 100, unit: 'ms', type: 'integer' },
62-
log_attr: { value: 'scope_attr_3', type: 'string' },
62+
log_attr: { value: 'log_attr_3', type: 'string' },
6363
},
6464
},
6565
{
@@ -74,7 +74,7 @@ sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page
7474
global_scope_attr: { value: true, type: 'boolean' },
7575
isolation_scope_1_attr: { value: 100, unit: 'ms', type: 'integer' },
7676
scope_attr: { value: 200, unit: 'ms', type: 'integer' },
77-
log_attr: { value: 'scope_attr_4', type: 'string' },
77+
log_attr: { value: 'log_attr_4', type: 'string' },
7878
},
7979
},
8080
{
@@ -89,7 +89,7 @@ sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page
8989
global_scope_attr: { value: true, type: 'boolean' },
9090
isolation_scope_1_attr: { value: 100, unit: 'ms', type: 'integer' },
9191
scope_2_attr: { value: 300, unit: 'ms', type: 'integer' },
92-
log_attr: { value: 'scope_attr_5', type: 'string' },
92+
log_attr: { value: 'log_attr_5', type: 'string' },
9393
},
9494
},
9595
],

0 commit comments

Comments
 (0)