samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.85k stars 95 forks source link

Question: How to improve unit / E2E test speed #865

Closed DavidVaness closed 6 months ago

DavidVaness commented 7 months ago

Question

Hey @samchon, based on your previous comments on typia's requirements, we are not able to switch from webpack to something like swc.

Currently we use Jest with ts-jest, which is incredibly slow. Do you have any thoughts on how to improve test speed? I would love to move to use swc+vitest, even if only for running the tests. Did you try something like mocking the nestia Decorators + some of typia's functions to enable a switch like this?

Thank you for the great libraries

samchon commented 7 months ago

I'm not using jest in the same reason.

Instead, I'm composing the test program like below. The test program utilizes SDK library generated by @nestia/sdk, so that performs e2e test for each API endpoints. If you put some function under the test/srcfeatures directory, then it would be exeucted when run the npm run test command.

https://github.com/samchon/bbs-backend/tree/master/test

DavidVaness commented 7 months ago

Thanks for linking up the example. For production use I would prefer a bit more structure and aligned with common testing frameworks (eg vitest) but I will consider it. Thanks @samchon