@@ -49,6 +49,7 @@ describe('Profiler', () => {
4949
5050 it ( 'constructor should use defaults for measure' , ( ) => {
5151 const customProfiler = getProfiler ( { color : 'secondary' } ) ;
52+ customProfiler . setEnabled ( true ) ;
5253
5354 const result = customProfiler . measure ( 'test-operation' , ( ) => 'success' ) ;
5455
@@ -148,6 +149,7 @@ describe('Profiler', () => {
148149
149150 it ( 'marker should execute without error when enabled' , ( ) => {
150151 const enabledProfiler = getProfiler ( ) ;
152+ enabledProfiler . setEnabled ( true ) ;
151153 expect ( ( ) => {
152154 enabledProfiler . marker ( 'test-marker' , {
153155 color : 'primary' ,
@@ -176,6 +178,7 @@ describe('Profiler', () => {
176178 performance . clearMarks ( ) ;
177179
178180 const profilerWithColor = getProfiler ( { color : 'primary' } ) ;
181+ profilerWithColor . setEnabled ( true ) ;
179182
180183 expect ( ( ) => {
181184 profilerWithColor . marker ( 'test-marker-default-color' , {
@@ -200,6 +203,7 @@ describe('Profiler', () => {
200203
201204 it ( 'marker should execute without error when enabled with no default color' , ( ) => {
202205 const profilerNoColor = getProfiler ( ) ;
206+ profilerNoColor . setEnabled ( true ) ;
203207
204208 expect ( ( ) => {
205209 profilerNoColor . marker ( 'test-marker-no-color' , {
@@ -244,6 +248,7 @@ describe('Profiler', () => {
244248 performance . clearMeasures ( ) ;
245249
246250 const enabledProfiler = getProfiler ( ) ;
251+ enabledProfiler . setEnabled ( true ) ;
247252 const workFn = vi . fn ( ( ) => 'result' ) ;
248253 const result = enabledProfiler . measure ( 'test-event' , workFn , {
249254 color : 'primary' ,
@@ -320,6 +325,7 @@ describe('Profiler', () => {
320325
321326 it ( 'measure should propagate errors when enabled and call error callback' , ( ) => {
322327 const enabledProfiler = getProfiler ( ) ;
328+ enabledProfiler . setEnabled ( true ) ;
323329 const error = new Error ( 'Enabled test error' ) ;
324330 const workFn = vi . fn ( ( ) => {
325331 throw error ;
@@ -358,6 +364,7 @@ describe('Profiler', () => {
358364
359365 it ( 'measureAsync should handle async operations correctly when enabled' , async ( ) => {
360366 const enabledProfiler = getProfiler ( ) ;
367+ enabledProfiler . setEnabled ( true ) ;
361368 const workFn = vi . fn ( async ( ) => {
362369 await Promise . resolve ( ) ;
363370 return 'async-result' ;
@@ -430,6 +437,7 @@ describe('Profiler', () => {
430437
431438 it ( 'measureAsync should propagate async errors when enabled and call error callback' , async ( ) => {
432439 const enabledProfiler = getProfiler ( ) ;
440+ enabledProfiler . setEnabled ( true ) ;
433441 const error = new Error ( 'Enabled async test error' ) ;
434442 const workFn = vi . fn ( async ( ) => {
435443 await Promise . resolve ( ) ;
0 commit comments