@@ -210,14 +210,14 @@ test('object destructure', () => {
210
210
`let n = _ref(1), { a: __a, b: __c, d: __d = 1, e: __f = 2, ...__g } = (useFoo())`
211
211
)
212
212
expect ( code ) . toMatch ( `let { foo: __foo } = (useSomthing(() => 1))` )
213
- expect ( code ) . toMatch ( `\nconst a = _ref (__a);` )
214
- expect ( code ) . not . toMatch ( `\nconst b = _ref (__b);` )
215
- expect ( code ) . toMatch ( `\nconst c = _ref (__c);` )
216
- expect ( code ) . toMatch ( `\nconst d = _ref (__d);` )
217
- expect ( code ) . not . toMatch ( `\nconst e = _ref (__e);` )
218
- expect ( code ) . toMatch ( `\nconst f = _ref (__f);` )
219
- expect ( code ) . toMatch ( `\nconst g = _ref (__g);` )
220
- expect ( code ) . toMatch ( `\nconst foo = _ref (__foo);` )
213
+ expect ( code ) . toMatch ( `\nconst a = _shallowRef (__a);` )
214
+ expect ( code ) . not . toMatch ( `\nconst b = _shallowRef (__b);` )
215
+ expect ( code ) . toMatch ( `\nconst c = _shallowRef (__c);` )
216
+ expect ( code ) . toMatch ( `\nconst d = _shallowRef (__d);` )
217
+ expect ( code ) . not . toMatch ( `\nconst e = _shallowRef (__e);` )
218
+ expect ( code ) . toMatch ( `\nconst f = _shallowRef (__f);` )
219
+ expect ( code ) . toMatch ( `\nconst g = _shallowRef (__g);` )
220
+ expect ( code ) . toMatch ( `\nconst foo = _shallowRef (__foo);` )
221
221
expect ( code ) . toMatch (
222
222
`console.log(n.value, a.value, c.value, d.value, f.value, g.value, foo.value)`
223
223
)
@@ -231,9 +231,9 @@ test('array destructure', () => {
231
231
console.log(n, a, b, c)
232
232
` )
233
233
expect ( code ) . toMatch ( `let n = _ref(1), [__a, __b = 1, ...__c] = (useFoo())` )
234
- expect ( code ) . toMatch ( `\nconst a = _ref (__a);` )
235
- expect ( code ) . toMatch ( `\nconst b = _ref (__b);` )
236
- expect ( code ) . toMatch ( `\nconst c = _ref (__c);` )
234
+ expect ( code ) . toMatch ( `\nconst a = _shallowRef (__a);` )
235
+ expect ( code ) . toMatch ( `\nconst b = _shallowRef (__b);` )
236
+ expect ( code ) . toMatch ( `\nconst c = _shallowRef (__c);` )
237
237
expect ( code ) . toMatch ( `console.log(n.value, a.value, b.value, c.value)` )
238
238
expect ( rootVars ) . toStrictEqual ( [ 'n' , 'a' , 'b' , 'c' ] )
239
239
assertCode ( code )
@@ -247,11 +247,11 @@ test('nested destructure', () => {
247
247
` )
248
248
expect ( code ) . toMatch ( `let [{ a: { b: __b }}] = (useFoo())` )
249
249
expect ( code ) . toMatch ( `let { c: [__d, __e] } = (useBar())` )
250
- expect ( code ) . not . toMatch ( `\nconst a = _ref (__a);` )
251
- expect ( code ) . not . toMatch ( `\nconst c = _ref (__c);` )
252
- expect ( code ) . toMatch ( `\nconst b = _ref (__b);` )
253
- expect ( code ) . toMatch ( `\nconst d = _ref (__d);` )
254
- expect ( code ) . toMatch ( `\nconst e = _ref (__e);` )
250
+ expect ( code ) . not . toMatch ( `\nconst a = _shallowRef (__a);` )
251
+ expect ( code ) . not . toMatch ( `\nconst c = _shallowRef (__c);` )
252
+ expect ( code ) . toMatch ( `\nconst b = _shallowRef (__b);` )
253
+ expect ( code ) . toMatch ( `\nconst d = _shallowRef (__d);` )
254
+ expect ( code ) . toMatch ( `\nconst e = _shallowRef (__e);` )
255
255
expect ( rootVars ) . toStrictEqual ( [ 'b' , 'd' , 'e' ] )
256
256
assertCode ( code )
257
257
} )
0 commit comments