Repository navigation
chore(tests): add Vitest unit tests and coverage - #1331
Conversation
|
@6pac hi there, I copied a few of my unit tests (using Vitest) into the project with help from AI of course... Another thing you could do is to register on Codecov at https://app.codecov.io/login it's free for Open Source project and this will allow you to show a badge of unit test coverage (%) and show it on the readme page. The other advantage is that you can see exactly the coverage on a website. Note that Codecov is totally optional, the PR works already and it shows coverage inside the CI workflow. Current coverage is 82.61% which is pretty good already and we should be able to reach 100% easily I'll let you merge the PR if you're interested in unit tests, which is probably better than Cypress quirks tests that Claude added. |
|
More test are always good! I've been looking into testing framwworks lately because the AI tool are so Test-driven (TDD). Have added CodeCov as per instructions, I guess we'll see if I got it right next PR! |
|
@6pac the next step is to add the I guess you did the steps because we received the "Welcome to Codecov" after I uncommented codecov upload in CI... if so go ahead and merge, we should see the Codecov badge of coverage % on readme page |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
@ghiscoding yes, I followed all the instructions on the CodeCov site, added the secret value and actually even added the line to the CI yaml file. Hence my comment about seeing if I got it right in the next release. |
Summary
Add Vitest unit testing and coverage reporting to the project. It also removes the super old tests that were tested via Qunit from jQuery I think, we never ran them anyway.
Why
Provide unit test coverage for plugin behavior and run unit tests independently from the longer Cypress suite.
Changes
tests\folder that required QunitValidation
npm run testnpm run build --workspace=vite-demoComments
None.
AI / LLM assistance
Checklist