question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin to run tests with web-test-runner

See original GitHub issue

Is 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

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:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
mindreframercommented, Mar 25, 2021

@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.

2reactions
betabooncommented, Mar 25, 2021

i think i got it figured out: https://github.com/betaboon/vite-web-test-runner-plugin

tested for: svelte (working), react (working), vue (defunct)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found