jmcdo29 / nestjs-graphql-e2e-plugin

A repo to show how the NestJS GraphQL CLI Plugin can be used in E2E tests with Jest.
10 stars 0 forks source link

Slow Development Workflow Due to Rebuilds for E2E Tests #9

Closed simplenotezy closed 2 months ago

simplenotezy commented 2 months ago

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

  1. 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

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

simplenotezy commented 2 months ago

Damn, just found https://docs.nestjs.com/graphql/cli-plugin#integration-with-ts-jest-e2e-tests 🤦🏽‍♂️