Skip to content

mneveroff/vitest-demo-download-file

Repository files navigation

Vitest File Download Cover Image

NeverOff Demo - vitest-file-download

This repository demonstrates how to test file downloads using Vitest Browser mode.

demo.mp4

And an example of istanbul coverage report.

Image displaying 100% coverage of download process

Read the blog post here.

Getting started

  1. Run pnpm install
  2. Run pnpm run dev to see the downloads in action
  3. Run pnpm run test to see the test running in Chromium, Gecko and WebKit browsers.

To show coverage run npx vitest --browser.name chromium --coverage, add --ui if you want to see the Vitest UI with details on runtime & coverage.

About

Demonstrating approaches to handle file download testing in Vitest Browser

Topics

Resources

License

Stars

Watchers

Forks