# Vitest Demo

This demo shows how to use Vitest for testing a yFiles for HTML web application. For interaction with the web browser it uses Playwright.

To run the test:

1. Go to the demo's directory `demos-ts/testing/vitest`.
2. Run `npm install`.
3. Run the test with `npm run test`.
4. Run the test UI with `npm run test-ui`.

The test is run in Chromium in headless mode.

You can also just start the app and interact with it by running `npm run dev`.

A simple way to make a yFiles App testable is making the GraphComponent available to the testing framework. In this app, this is achieved by setting the instantiated GraphComponent as a property of the `Window` object.