it-at-m / refarch-templates

All templates for the Reference Architecture of it@M
MIT License
7 stars 4 forks source link

[Maintenance] Move unit testing for frontend components to real browser backend #357

Open devtobi opened 1 month ago

devtobi commented 1 month ago

Relevant template

refarch-frontend, refarch-webcomponent

Problem description (optional)

We are currently using jsdom as a DOM implementation when running Unit tests for Vue components. However jsdom only tries to mimic a real browser and does not 100% behave like a real one. That's where https://vitest.dev/guide/browser/ and https://github.com/vitest-dev/vitest-browser-vue can help out by allowing the unit tests to be run in a real browser (headless or via Cypress-like UI).

The usage of this library has to be evaluated. It's especially interesting to check if it can run properly in an CI/CD environment like GitHub Actions.

Desired solution

Move from jsdom based DOM implementation to a real browser using https://vitest.dev/guide/browser/ and https://github.com/vitest-dev/vitest-browser-vue

Considered alternatives (optional)

No response

Additional context (optional)

No response

No duplicate

Code of Conduct

devtobi commented 1 month ago

Settings this to blocked for now because usage of Vite Browser Mode is currently only "experimental" and no stable API is provided yet.