Vitest adds tsx support
Closed this issue · 5 comments
Additional context
Have you considered adding a jsx plug-in to Vitest? Tests will be easier to write.
import { defineConfig } from 'vitest/config'
import Vue from '@vitejs/plugin-vue'
import VueJsx from '@vitejs/plugin-vue-jsx'
export default defineConfig({
plugins: [
Vue(),
VueJsx(),
],
})
Can you send a sample, Also if you want to write tests I can define a privilege for it in the project.
Thank you message
你能发送一个样本吗,如果你想写测试,我可以在项目中为它定义一个特权。您可以发送一个示例吗?如果您想编写测试,我可以在项目中为其定义权限。
感谢留言
I am using oku-ui primitives to create my own ui library, but the number of ui is relatively small. I want to help contribute some components, but I am not used to writing tests only in ts. I feel a bit tedious.
It might also be nice to put them in the component or core in tests
folder and create a .vue there and then include the test. example radio-group folder
we can actually write .vue without the need for tsx. ? wouldn't that be better
primitives/packages/components/radio-group/tests/radio.test.ts
Lines 14 to 28 in c34e943
Or you can use it this way, or you can write
testComponent` as .vue in the tests folder, import it and duplicate the tests. I think we can go this way. what do you think about this
primitives/packages/components/radio-group/tests/radio.test.ts
Lines 14 to 28 in c34e943
Or you can use it this way, or you can write
testComponent` as .vue in the tests folder, import it and duplicate the tests. I think we can go this way. what do you think about this
I feel like your way of writing is enough, my question.