Replies: 1 comment
-
麻烦补一下所示链接的使用步骤吧,包括如何进行测试,执行什么命令可以出现你的错误 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reproduction Link
https://codesandbox.io/p/devbox/vant-4-issue-template-forked-w6qk8l?file=%2Fsrc%2Fcontr.test.ts
Vant Version
vant 4.9.4
Describe the Bug
Vue 3.0 + Vite + @vue/test-utils + Vitest
组件中使用了 vant(4.9.4),页面运行正常。但在做组件测试时,测试用例无法引入使用了vant 的组件.
Reproduce Steps
Vue 3.0 + Vite + @vue/test-utils + Vitest
组件中使用了 vant(4.9.4),页面运行正常。但在做组件测试时,测试用例无法引入使用了vant 的组件,代码如下:
import { mount } from '@vue/test-utils'
import { expect, test } from 'vitest'
import Controller from '../../views/controller.vue'
test('renders a play button', () => {
const wrapper = mount(Controller)
expect(wrapper.exists()).toBe(true);
})
报错如下:
FAIL tests/views/controller.test.ts [ tests/views/controller.test.ts ]
TypeError: Unknown file extension ".css" for E:...\node_modules.pnpm\vant@4.9.4_vue@3.4.38_typescript@5.5.4_\node_modules\vant\es\style\base.css
Device / Browser
VSCode + chorme
Beta Was this translation helpful? Give feedback.
All reactions