Samagra-Development / Doc-Generator

Create PDFs from a variety of formats.
17 stars 45 forks source link

fix(api): fixed the the app.e2e-spec.ts by mocking the PrismaService #140

Closed VarunGitGood closed 1 year ago

VarunGitGood commented 1 year ago

changed the file layout a bit there was no PrimsaModule so used nest CLI to generate it made sure everythingworks

closes #132

VarunGitGood commented 1 year ago

@AnshulMalik @yuvrajsab can you please review this

Thanks!!

AnshulMalik commented 1 year ago

Hey @varun7singh, Thanks for the PR.

The current mock approach, we won't be able to test the actual functionality in future, we need to mock the client, but should behave like prisma client and not connect to actual database at the same time.

Here is how the official documentation suggests: https://www.prisma.io/docs/guides/testing/unit-testing

VarunGitGood commented 1 year ago

Oh okay sure Thanks !! will look into it and commit again

VarunGitGood commented 1 year ago

@AnshulMalik do look into this PR i referred to the docs and use mockDeep to create a mock instance of PrismaService

do let me know for any more changes

Thanks !!