chore: cleanup

This commit is contained in:
zernonia 2023-09-18 22:38:37 +08:00
parent ef452dfea6
commit 0b39d050b3
2 changed files with 13 additions and 17 deletions

View File

@ -1,12 +0,0 @@
<script lang="ts" setup>
const array: (number | string)[] = [1, 2, 3]
</script>
<template>
<div v-bind="{ array }">
template
</div>
</template>
<style scoped>
</style>

View File

@ -1,15 +1,23 @@
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, expect, test } from 'vitest' import { describe, expect, test } from 'vitest'
import { transform } from '../../src/utils/transformers' import { transform } from '../../src/utils/transformers'
describe('transformSFC', () => { describe('transformSFC', () => {
const appVuePath = resolve(__dirname, '../fixtures/transform-sfc/app.vue')
const content = readFileSync(appVuePath, 'utf-8')
test('basic', async () => { test('basic', async () => {
const result = await transform({ const result = await transform({
filename: 'app.vue', filename: 'app.vue',
raw: content, raw: `<script lang="ts" setup>
const array: (number | string)[] = [1, 2, 3]
</script>
<template>
<div v-bind="{ array }">
template
</div>
</template>
<style scoped>
</style>
`,
config: {}, config: {},
}) })
expect(result).toMatchSnapshot() expect(result).toMatchSnapshot()