import { resolve } from 'node:path'
import { describe, expect, test } from 'vitest'
import { transform } from '../../src/utils/transformers'
describe('transformSFC', () => {
test('basic', async () => {
const result = await transform({
filename: 'app.vue',
raw: `
template
`,
config: {},
})
expect(result).toMatchSnapshot()
})
test('defineProps', async () => {
const result = await transform({
filename: 'app.vue',
raw: `
`,
config: {},
})
expect(result).toMatchSnapshot()
})
test('defineProps with withDefaults', async () => {
const result = await transform({
filename: 'app.vue',
raw: `
`,
config: {},
})
expect(result).toMatchSnapshot()
})
test('defineProps with external props', async () => {
const result = await transform({
filename: resolve(__dirname, './test.vue'),
raw: `
`,
config: {},
})
expect(result).toMatchSnapshot()
})
test('defineProps with package props', async () => {
const result = await transform({
filename: resolve(__dirname, './test.vue'),
raw: `
`,
config: {},
})
// TODO: Ignore test until https://github.com/radix-vue/shadcn-vue/issues/187 is resolved
// expect(result).toMatchSnapshot()
})
test('defineEmits', async () => {
const result = await transform({
filename: 'app.vue',
raw: `
`,
config: {},
})
expect(result).toMatchSnapshot()
})
})