let foo = $ref(1)
</script>
`,
- { refSugar: true }
+ { refTransform: true }
)
assertCode(content)
expect(content).toMatch(`import { ref } from 'vue'`)
describe('async/await detection', () => {
function assertAwaitDetection(code: string, shouldAsync = true) {
const { content } = compile(`<script setup>${code}</script>`, {
- refSugar: true
+ refTransform: true
})
if (shouldAsync) {
expect(content).toMatch(`let __temp, __restore`)
// transform can be found in <root>/packages/ref-transform/__tests__
describe('sfc ref transform', () => {
function compileWithRefTransform(src: string) {
- return compile(src, { refSugar: true })
+ return compile(src, { refTransform: true })
}
test('$ unwrapping', () => {
bar
})
</script>`,
- { refSugar: true }
+ { refTransform: true }
)
).toThrow(`cannot reference locally declared variables`)
bar
})
</script>`,
- { refSugar: true }
+ { refTransform: true }
)
).toThrow(`cannot reference locally declared variables`)
})