wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.63k stars 1.18k forks source link

Unit test all of our framework code #2221

Open infomiho opened 2 months ago

infomiho commented 2 months ago

Right now, it's quite difficult to unit test Wasp's framework code because a lot of it is in Mustache templates. That's why we didn't immediately test it with unit tests when we wrote the code.

Unit tests in userland

The thinking now is that we can do this but in a bit of an indirect way: by building example apps that use the framework and we can then write unit tests for the publicly exposed functions in the user land.

Unit tests by copy-paste

Another approach we could do is just to copy paste unit tests in built projects and then running them. In this case, we would still have example apps for various scenarios - but we run the unit tests inside of .wasp/out folders i.e. by copy pasting them there and running something like npx vitest run.

Martinsos commented 2 months ago

I am not sure if this can be called unit tests. Maybe integration tests? Not sure if that is correct either, but feels more correct. Or even e2e tests of a kind?