Run all unit test in watch mode:
yarn testGenerate a coverage report:
yarn test:coverageRun tests using the vitest ui:
yarn test:uiPlaywright is run for every push to a branch against an ephemeral instance that is deployed to Vercel.
A special test page shows all the charts used in the E2E suite. Those chart configurations are kept in the repository.
To run the E2E tests locally:
yarn e2e:devTo launch the Playwright UI and run tests interactively:
yarn e2e:uiSome e2e use har files to mock the backend. To update the har files, you can use the following command:
yarn e2e:har-update <test-file-name>Commit the updated zip file(s) to the repository.
It's sometimes useful to run visual regression tests, especially when modifying chart configurator or chart config schemas. To make sure that the changes don't break the existing charts, we implemented a way to do a baseline vs. comparison tests locally.
To run the tests, you should check out the instruction in e2e/all-charts.spec.ts file.