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.
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?
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 likenpx vitest run
.