File tree 1 file changed +1
-22
lines changed
packages/svelte/tests/runtime-runes/samples/state-reuse 1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change 1
1
import { test } from '../../test' ;
2
2
3
- /**
4
- * @type {any[] }
5
- */
6
- let log ;
7
- /**
8
- * @type {typeof console.warn }}
9
- */
10
- let original_log ;
11
-
12
3
export default test ( {
13
4
compileOptions : {
14
5
dev : true
15
6
} ,
16
- before_test ( ) {
17
- log = [ ] ;
18
- original_log = console . warn ;
19
- console . warn = ( ...v ) => {
20
- log . push ( ...v ) ;
21
- } ;
22
- } ,
23
- after_test ( ) {
24
- console . warn = original_log ;
25
- } ,
7
+
26
8
html : `<button>state1.value: a state2.value: a</button>` ,
27
9
28
10
async test ( { assert, target } ) {
29
11
const btn = target . querySelector ( 'button' ) ;
30
12
31
13
await btn ?. click ( ) ;
32
14
assert . htmlEqual ( target . innerHTML , `<button>state1.value: b state2.value: b</button>` ) ;
33
- assert . deepEqual ( log , [
34
- 'Object passed to $state was frozen after being passed to $state before. Consider using $state.frozen instead, or unfreeze the object.'
35
- ] ) ;
36
15
}
37
16
} ) ;
You can’t perform that action at this time.
0 commit comments