Skip to content

Commit 31b3866

Browse files
committed
feat(compiler-sfc): updated unit test
1 parent 75ec1a9 commit 31b3866

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/compiler-sfc/__tests__/compileScriptPropsTransform.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ describe('sfc props transform', () => {
102102
test('default values w/ type declaration & key is string', () => {
103103
const { content } = compile(`
104104
<script setup lang="ts">
105-
const { foo = 1 } = defineProps<{ foo: number }>()
105+
const { foo = 1 } = defineProps<{ "foo": number }>()
106106
</script>
107107
`)
108-
expect(content).toMatch(`props: {
109-
"\\foo\\": { type: Number, required: false, default: 1 }
110-
}`)
108+
expect(content).toMatch(`
109+
props: {
110+
"foo": { type: Number, required: true, default: 1 }
111+
},`)
111112
assertCode(content)
112113
})
113114

0 commit comments

Comments
 (0)