@@ -4,12 +4,12 @@ import { compileSFCScript as compile, assertCode } from './utils'
4
4
// this file only tests integration with SFC - main test case for the ref
5
5
// transform can be found in <root>/packages/reactivity-transform/__tests__
6
6
describe ( 'sfc ref transform' , ( ) => {
7
- function compileWithRefTransform ( src : string ) {
8
- return compile ( src , { refTransform : true } )
7
+ function compileWithReactivityTransform ( src : string ) {
8
+ return compile ( src , { reactivityTransform : true } )
9
9
}
10
10
11
11
test ( '$ unwrapping' , ( ) => {
12
- const { content, bindings } = compileWithRefTransform ( `<script setup>
12
+ const { content, bindings } = compileWithReactivityTransform ( `<script setup>
13
13
import { ref, shallowRef } from 'vue'
14
14
let foo = $(ref())
15
15
let a = $(ref(1))
@@ -46,7 +46,7 @@ describe('sfc ref transform', () => {
46
46
} )
47
47
48
48
test ( '$ref & $shallowRef declarations' , ( ) => {
49
- const { content, bindings } = compileWithRefTransform ( `<script setup>
49
+ const { content, bindings } = compileWithReactivityTransform ( `<script setup>
50
50
let foo = $ref()
51
51
let a = $ref(1)
52
52
let b = $shallowRef({
@@ -82,7 +82,7 @@ describe('sfc ref transform', () => {
82
82
} )
83
83
84
84
test ( 'usage in normal <script>' , ( ) => {
85
- const { content } = compileWithRefTransform ( `<script>
85
+ const { content } = compileWithReactivityTransform ( `<script>
86
86
export default {
87
87
setup() {
88
88
let count = $ref(0)
@@ -100,7 +100,7 @@ describe('sfc ref transform', () => {
100
100
} )
101
101
102
102
test ( 'usage /w typescript' , ( ) => {
103
- const { content } = compileWithRefTransform ( `
103
+ const { content } = compileWithReactivityTransform ( `
104
104
<script setup lang="ts">
105
105
let msg = $ref<string | number>('foo');
106
106
let bar = $ref <string | number>('bar');
@@ -113,7 +113,7 @@ describe('sfc ref transform', () => {
113
113
} )
114
114
115
115
test ( 'usage with normal <script> + <script setup>' , ( ) => {
116
- const { content, bindings } = compileWithRefTransform ( `<script>
116
+ const { content, bindings } = compileWithReactivityTransform ( `<script>
117
117
let a = $ref(0)
118
118
let c = $ref(0)
119
119
</script>
@@ -156,7 +156,7 @@ describe('sfc ref transform', () => {
156
156
bar
157
157
})
158
158
</script>` ,
159
- { refTransform : true }
159
+ { reactivityTransform : true }
160
160
)
161
161
) . toThrow ( `cannot reference locally declared variables` )
162
162
@@ -168,7 +168,7 @@ describe('sfc ref transform', () => {
168
168
bar
169
169
})
170
170
</script>` ,
171
- { refTransform : true }
171
+ { reactivityTransform : true }
172
172
)
173
173
) . toThrow ( `cannot reference locally declared variables` )
174
174
} )
0 commit comments