@@ -15,6 +15,7 @@ import { derived } from '../../src/internal/client/reactivity/deriveds';
15
15
import { snapshot } from '../../src/internal/shared/clone.js' ;
16
16
import { SvelteSet } from '../../src/reactivity/set' ;
17
17
import { DESTROYED } from '../../src/internal/client/constants' ;
18
+ import { noop } from 'svelte/internal/client' ;
18
19
19
20
/**
20
21
* @param runes runes mode
@@ -469,6 +470,9 @@ describe('signals', () => {
469
470
test ( 'schedules rerun when writing to signal before reading it' , ( runes ) => {
470
471
if ( ! runes ) return ( ) => { } ;
471
472
473
+ const error = console . error ;
474
+ console . error = noop ;
475
+
472
476
const value = state ( { count : 0 } ) ;
473
477
user_effect ( ( ) => {
474
478
set ( value , { count : 0 } ) ;
@@ -482,14 +486,19 @@ describe('signals', () => {
482
486
} catch ( e : any ) {
483
487
assert . include ( e . message , 'effect_update_depth_exceeded' ) ;
484
488
errored = true ;
489
+ } finally {
490
+ assert . equal ( errored , true ) ;
491
+ console . error = error ;
485
492
}
486
- assert . equal ( errored , true ) ;
487
493
} ;
488
494
} ) ;
489
495
490
496
test ( 'schedules rerun when updating deeply nested value' , ( runes ) => {
491
497
if ( ! runes ) return ( ) => { } ;
492
498
499
+ const error = console . error ;
500
+ console . error = noop ;
501
+
493
502
const value = proxy ( { a : { b : { c : 0 } } } ) ;
494
503
user_effect ( ( ) => {
495
504
value . a . b . c += 1 ;
@@ -502,14 +511,19 @@ describe('signals', () => {
502
511
} catch ( e : any ) {
503
512
assert . include ( e . message , 'effect_update_depth_exceeded' ) ;
504
513
errored = true ;
514
+ } finally {
515
+ assert . equal ( errored , true ) ;
516
+ console . error = error ;
505
517
}
506
- assert . equal ( errored , true ) ;
507
518
} ;
508
519
} ) ;
509
520
510
521
test ( 'schedules rerun when writing to signal before reading it' , ( runes ) => {
511
522
if ( ! runes ) return ( ) => { } ;
512
523
524
+ const error = console . error ;
525
+ console . error = noop ;
526
+
513
527
const value = proxy ( { arr : [ ] } ) ;
514
528
user_effect ( ( ) => {
515
529
value . arr = [ ] ;
@@ -523,8 +537,10 @@ describe('signals', () => {
523
537
} catch ( e : any ) {
524
538
assert . include ( e . message , 'effect_update_depth_exceeded' ) ;
525
539
errored = true ;
540
+ } finally {
541
+ assert . equal ( errored , true ) ;
542
+ console . error = error ;
526
543
}
527
- assert . equal ( errored , true ) ;
528
544
} ;
529
545
} ) ;
530
546
0 commit comments