Plugin to run tests with web-test-runner
See original GitHub issueIs your feature request related to a problem? Please describe. Currently we have no proper way of executing tests with Vite.js. There exists an increasing desire from the community for a blessed alternative how to test your code with Vite.js.
Describe the solution you’d like
Snowpack solves this by providing a plugin for web-test-runner
- https://modern-web.dev/docs/test-runner/overview/
- https://www.snowpack.dev/guides/web-test-runner/
- @snowpack/web-test-runner-plugin
Describe alternatives you’ve considered
- many others, like jest / uvu / etc. They all had different issues in combination with Typescript / React / Vite.js.
- Currently I’m including snowpack with plugins just to be able to execute my tests with
WTR
, yet this is far from being optimal and still has issues (eg. using WindiCSS is impossible in tests)
Additional context
It would be great to have an official plugin for web-test-runner
, because this would allow testing in many browers and Node.js with different testing libraries, while still providing great developer ergonomics.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:18 (6 by maintainers)
Top Results From Across the Web
Web Test Runner
Web Test Runner. Test runner for web applications. Headless browsers with Puppeteer, Playwright, Selenium or WebdriverIO.
Read more >@web/test-runner - Snowpack
This guide shows how to set up @web/test-runner and @snowpack/web-test-runner-plugin for a React project. The end result recreates the test configuration in app ......
Read more >Testing with Jasmine and Web Test Runner - Cory Rylan
Using the web-test-runner-jasmine package, we can use Jasmine tests with @web/test-runner . To start, we need to create a basic web-test-runner.
Read more >@snowpack/web-test-runner-plugin - npm
This plugin automatically connects to the Snowpack project in the current ... your project by running `npm i @snowpack/web-test-runner-plugin`.
Read more >web/test-runner-extension - Visual Studio Marketplace
Extension for Visual Studio Code - vscode plugin for @web/test-runner to run / debug one or more test.
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
@aelbore Hey, thanks, this looks nice! In the meantime I decided to stick to plain Jest tests (with JSDom for some React.js code) and I’m using your https://github.com/aelbore/esbuild-jest package for this 😃
This seems to work out OK for now, I might play a bit with https://github.com/aelbore/vite-plugin-test on weekend or next week, currently I cant justify spending more time on this. Its sad that there is no blessed recommendation about how to deal with this, so every-one seems to re-invent the wheel for testing. On the other hand I also understand that there is only so much @yyx990803 can do by himself. I guess this topic will become more relevant once Vite.js stabilises, currently it’s in a state of wild innovation 😅 .
I hope this issue helps other community members to understand their alternatives for testing with Vite.js until there is a more “official” solution.
i think i got it figured out: https://github.com/betaboon/vite-web-test-runner-plugin
tested for: svelte (working), react (working), vue (defunct)