Subject
- #Unit Testing
- #NestJS
Created: 2024-04-02
Created: 2024-04-02 03:01
Application unit tests should ideally be conducted in isolation. Therefore, it's recommended to eliminate external dependencies like network I/O, databases, etc., that could potentially affect the test results.
In this toy project, I'm using Prisma ORM, and I'm writing this post to document a simple way to mock Prisma Client for unit testing purposes.
This command installs the package recommended in the official Prisma documentation.
After mocking, type support is also provided, making unit test writing incredibly convenient.
Comments0