How to use this with unit tests?
See original GitHub issueAs this is a vite plugin it won’t be utilized when running unit test and all components won’t be transformed.
Is there any trick to get this working with the vue-test-utils
/ jest
?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:20
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Unit Testing Tutorial: 6 Best Practices to Get Up To Speed
1. Arrange, Act, Assert · 2. One Assert Per Test Method · 3. Avoid Test Interdependence · 4. Keep It Short, Sweet, and...
Read more >Unit Tests, How to Write Testable Code, and Why It Matters
A typical unit test contains 3 phases: First, it initializes a small piece of an application it wants to test (also known as...
Read more >Unit Testing Tutorial – What is, Types & Test Example - Guru99
Unit Test cases should be independent. · Test only one code at a time. · Follow clear and consistent naming conventions for your...
Read more >Getting Started With Testing in Python
On the context menu, choose the run command for unittest . For example, choose Run 'Unittests in my Tests…'. This will execute unittest...
Read more >unittest — Unit testing framework — Python 3.11.1 ...
A test runner is a component which orchestrates the execution of tests and provides the outcome to the user. The runner may use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So the simple answer to this seems to be now: Use vitest for testing!
@husayt Cypress has a component testing solution for Vue now that’s built on top of Vue Test Utils + Vite - it came out in the last couple of major Cypress versions. This might be what @antfu is referring to. I haven’t tested it with this package but I’ve been using it where I would have used jest component tests in the past: https://www.cypress.io/blog/2021/04/06/getting-start-with-cypress-component-testing-vue-2-3/