1
1
import type { Breadcrumb , Scope } from '@sentry/types' ;
2
2
3
+ import { CONSOLE_ARG_MAX_SIZE } from '../../../src/constants' ;
3
4
import * as HandleScope from '../../../src/coreHandlers/handleScope' ;
4
5
5
6
describe ( 'Unit | coreHandlers | handleScope' , ( ) => {
@@ -97,10 +98,7 @@ describe('Unit | coreHandlers | handleScope', () => {
97
98
category : 'console' ,
98
99
message : 'test' ,
99
100
data : {
100
- arguments : [
101
- 'a' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE + 10 ) ,
102
- 'b' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE + 10 ) ,
103
- ] ,
101
+ arguments : [ 'a' . repeat ( CONSOLE_ARG_MAX_SIZE + 10 ) , 'b' . repeat ( CONSOLE_ARG_MAX_SIZE + 10 ) ] ,
104
102
} ,
105
103
} ;
106
104
const actual = HandleScope . normalizeConsoleBreadcrumb ( breadcrumb ) ;
@@ -109,10 +107,7 @@ describe('Unit | coreHandlers | handleScope', () => {
109
107
category : 'console' ,
110
108
message : 'test' ,
111
109
data : {
112
- arguments : [
113
- `${ 'a' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE ) } …` ,
114
- `${ 'b' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE ) } …` ,
115
- ] ,
110
+ arguments : [ `${ 'a' . repeat ( CONSOLE_ARG_MAX_SIZE ) } …` , `${ 'b' . repeat ( CONSOLE_ARG_MAX_SIZE ) } …` ] ,
116
111
_meta : { warnings : [ 'CONSOLE_ARG_TRUNCATED' ] } ,
117
112
} ,
118
113
} ) ;
@@ -125,8 +120,8 @@ describe('Unit | coreHandlers | handleScope', () => {
125
120
data : {
126
121
arguments : [
127
122
{ aa : 'yes' } ,
128
- { bb : 'b' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE + 10 ) } ,
129
- { c : 'c' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE + 10 ) } ,
123
+ { bb : 'b' . repeat ( CONSOLE_ARG_MAX_SIZE + 10 ) } ,
124
+ { c : 'c' . repeat ( CONSOLE_ARG_MAX_SIZE + 10 ) } ,
130
125
] ,
131
126
} ,
132
127
} ;
@@ -138,8 +133,8 @@ describe('Unit | coreHandlers | handleScope', () => {
138
133
data : {
139
134
arguments : [
140
135
{ aa : 'yes' } ,
141
- { bb : `${ 'b' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE - 7 ) } ~~` } ,
142
- { c : `${ 'c' . repeat ( HandleScope . CONSOLE_ARG_MAX_SIZE - 6 ) } ~~` } ,
136
+ { bb : `${ 'b' . repeat ( CONSOLE_ARG_MAX_SIZE - 7 ) } ~~` } ,
137
+ { c : `${ 'c' . repeat ( CONSOLE_ARG_MAX_SIZE - 6 ) } ~~` } ,
143
138
] ,
144
139
_meta : { warnings : [ 'CONSOLE_ARG_TRUNCATED' ] } ,
145
140
} ,
0 commit comments