When writing E2E tests in the current setup, the development process becomes slow because the project needs to be fully rebuilt each time a test is run. This rebuild process hinders the ability to use watch capabilities, which could otherwise speed up the testing and development cycle.
The current solution of compiling all TS files and running them as JS files in Jest works but is cumbersome and not ideal for a streamlined development workflow.
Potential Solutions to Discuss
Tweak ts-jest Compiler:
Investigate whether it is possible to tweak ts-jest's compiler to apply the same modifications that NestJS uses for auto-generating GraphQL models. This would allow us to bypass the need for full project rebuilds and leverage Jest's watch capabilities directly.
Open Questions
What are the specific tweaks that NestJS applies to the TypeScript compiler for GraphQL model generation?
How feasible is it to integrate these tweaks into ts-jest?
Are there other known workarounds or best practices for testing NestJS with GraphQL that could reduce the need for full rebuilds? Perhaps simply just apply @Field() to all entities?
Request for Input
Looking for input on potential solutions and whether anyone has experience or insights into modifying ts-jest that could solve this issue
When writing E2E tests in the current setup, the development process becomes slow because the project needs to be fully rebuilt each time a test is run. This rebuild process hinders the ability to use watch capabilities, which could otherwise speed up the testing and development cycle.
The current solution of compiling all TS files and running them as JS files in Jest works but is cumbersome and not ideal for a streamlined development workflow.
Potential Solutions to Discuss
ts-jest
Compiler:ts-jest
's compiler to apply the same modifications that NestJS uses for auto-generating GraphQL models. This would allow us to bypass the need for full project rebuilds and leverage Jest's watch capabilities directly.Open Questions
ts-jest
?Request for Input
Looking for input on potential solutions and whether anyone has experience or insights into modifying
ts-jest
that could solve this issue