shadcn-vue/packages/cli/test/utils/transform-sfc.test.ts
Dunqing ad05aab3d2
feat(cli): support remove type when non-typescript (#45)
* fix(cli): shouldn't load tsconfig when typescript disabled

* feat(cli): support remove type when non-typescript

* feat: patch `detype` and fix ts extension

* test: update

* chore: update lock

* feat: patch again

* fix: missing

* chore: update lock

* feat: support root option

* chore: update lock

* feat: transform utils to js by detype

* refactor: load jsconfig and remove root option

* chore: remove babel/core
2023-09-18 15:19:59 +08:00

19 lines
561 B
TypeScript

import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, expect, test } from 'vitest'
import { transformSFC } from '../../src/utils/transformers/transform-sfc'
describe('transformSFC', () => {
const appVuePath = resolve(__dirname, '../fixtures/transform-sfc/app.vue')
const content = readFileSync(appVuePath, 'utf-8')
test('basic', async () => {
const result = await transformSFC({
name: 'app.vue',
content,
}, {
typescript: false,
} as any)
expect(result).toMatchSnapshot()
})
})