LeaVerou / htest

Declarative, boilerplate-free unit testing
https://htest.dev/
MIT License
19 stars 3 forks source link

Automated test runner #1

Closed LeaVerou closed 1 year ago

LeaVerou commented 1 year ago

This is a very common request for projects using htest, see e.g. https://github.com/LeaVerou/parsel/pull/49 . Having a UI with automated interactions, being able to test in multiple browsers, and being able to add tests by writing HTML is nice, but we also need the benefits of an automated testsuite, which is what most developers are used to.

As an MVP, it would probably be fairly easy to implement using a headless browser like Puppeteer and reading back the values of failing/passing tests from the DOM. It would be slow, but it would work.

For later, we could implement improvements where certain types of tests that don't need a DOM (e.g. Parsel tests are just comparing JS values) can be "fast-tracked" and run without the headless browser.

LeaVerou commented 1 year ago

The new JS-first mode does exactly that 😊 https://htest.dev/docs/js/