Trouble with component testing and vitest-browser-vue
#14858
Replies: 1 comment
-
|
I tried it again today and it seems to work fine. Not sure why I was having trouble. Closing all posts. |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am having some trouble getting the right setup for writing component tests. I have spent considerable effort getting familiar with the vue testing ecosystem and came up with a setup involving Vitest and
vitest-browser-vue.vitest-browser-vueis simply a component testing utility that uses Testing Library principles and makes use of Vitest's supposedly powerful browser mode. I am using Playwright as myproviderin the vitest configuration file and chromium as my browserinstance.The
vitest-browser-vuedocs are more or less clear on how to write a simple component test. I therefore created two simple components and wrote the folllowing tests:When I launch the test suite a browser window opens, showing me the Vitest browser mode UI. The first test runs and passes. The second test fails with the following error:
I had conversations with a number of LLMs (google AI, Claude and ChatGPT) but couldn't quite get to the bottom of how to fix this. I also made an active effort to reach out to the community:
vitest-browser-vuegithube repo: linkIt has been three days and I have not gotten any response as of yet. The fact I cannot run two consecutive tests on two separate components really undermines the whole point of using a library like
vitest-browser-vuein my opinion, so I am pretty sure I am doing something wrong on my end. Has anyone usedvitest-browser-vuein the past to test their components? How did you do it?Beta Was this translation helpful? Give feedback.
All reactions