* chore: bump detypes * test: update snapshot * test: add test to check all type references --------- Co-authored-by: zernonia <zernonia@gmail.com>
87 lines
1.6 KiB
Plaintext
87 lines
1.6 KiB
Plaintext
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
|
|
exports[`transformSFC > basic 1`] = `
|
|
"<script setup>
|
|
const array = [1, 2, 3];
|
|
</script>
|
|
|
|
<template>
|
|
<div v-bind="{ array }">template</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineEmits 1`] = `
|
|
"<script setup>
|
|
const emit = defineEmits(["foo"]);
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: true },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps with external props 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: false, default: "bar" },
|
|
a: { type: String, required: true },
|
|
b: { type: Number, required: true },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps with package props 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: false, default: "bar" },
|
|
for: { type: String, required: false },
|
|
asChild: { type: Boolean, required: false },
|
|
as: { type: null, required: false },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps with withDefaults 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: true, default: "bar" },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > remove all type reference 1`] = `
|
|
"<script setup>
|
|
const array = [1, 2, 3];
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
v-bind="{ array }"
|
|
:prop="(a) => a"
|
|
:prop2="
|
|
(a) => {
|
|
let b = a;
|
|
return b;
|
|
}
|
|
"
|
|
>
|
|
{{ true ? 123 : 0 }}
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|
|
"
|
|
`;
|