Raised: $0
0% of monthly goal Help us cross the finish line!
Goal: $12,000
Raised: $0 Goal: $12,000
0% of monthly goal Help us cross the finish line!
Sponsor DDEV

add-on registry tests last commit release

ddev-vitest

What is ddev-vitest?

ddev-vitest is a helper add-on for DDEV that improves the developer experience for projects using Vitest.

Vitest describes itself as a “next generation testing framework”, a fast “Vite-native” testing framework.

Components of the repository

Getting started

This add-on assumes the developer has:

  1. Install the add-on and restart DDEV

    ddev add-on get tyler36/ddev-vitest
    ddev restart
    

Commands

ddev vitest

ddev vitest is a helper command to run Vitest from the host. It accepts all flags accepted by vitest. For example, to see the currently installed version of Vitest:

  ddev vitest --version

Note

If you attempt to start Vitest UI via ddev vitest --ui, this addon hijacks the command and re-writes it to be compatible with DDEV.

ddev vitest-ui

Use the following command to start the Vitest UI server and launch the site in your default browser:

ddev vitest-ui -s

If the server is already started, use ddev vitest-ui to launch the site

Auto-start Vitest UI

Use DDEV’s post-start hook to automatically start Vitest UI.

The following snippet starts the UI server and launches the test page.

hooks:
  post-start:
    - exec-host: ddev vitest-ui

Vite

Vitest is a great companion to Vite. For more information about using Vite with DDEV,

Contributed and maintained by tyler36