File tree 1 file changed +4
-15
lines changed
packages/reactivity/__tests__
1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -109,21 +109,10 @@ describe('reactivity/ref', () => {
109
109
} )
110
110
111
111
it ( 'should NOT unwrap ref types nested inside arrays' , ( ) => {
112
- const arr = ref ( [ 1 , ref ( 1 ) ] ) . value
113
- ; ( arr [ 0 ] as number ) ++
114
- ; ( arr [ 1 ] as Ref < number > ) . value ++
115
-
116
- const arr2 = ref ( [ 1 , new Map < string , any > ( ) , ref ( '1' ) ] ) . value
117
- const value = arr2 [ 0 ]
118
- if ( isRef ( value ) ) {
119
- value + 'foo'
120
- } else if ( typeof value === 'number' ) {
121
- value + 1
122
- } else {
123
- // should narrow down to Map type
124
- // and not contain any Ref type
125
- value . has ( 'foo' )
126
- }
112
+ const arr = ref ( [ 1 , ref ( 3 ) ] ) . value
113
+ expect ( isRef ( arr [ 0 ] ) ) . toBe ( false )
114
+ expect ( isRef ( arr [ 1 ] ) ) . toBe ( true )
115
+ expect ( ( arr [ 1 ] as Ref ) . value ) . toBe ( 3 )
127
116
} )
128
117
129
118
it ( 'should keep tuple types' , ( ) => {
You can’t perform that action at this time.
0 commit comments