Skip to content

Conversation

@olivierwilkinson
Copy link
Owner

Add Prisma schema in order to generate a valid Prisma client for testing: when the client has not been generated the library throws because it requires the Prisma.dmmf object to exist. A benefit of having a generated client for testing is that we can leverage the generated types to ensure the params being used in the tests are valid.

Now that we have @prisma/client in the development setup we can use the official types in the main lib, they won't be used at build time but we can check the types when the development deps are installed. Change the @ts-expect-error above the import of the prisma client to @ts-ignore since during development we no longer expect an error.

There is one failing test which revealed a legitimate bug: it looks like deeply nested results cannot be modified before returning.

Add Prisma schema in order to generate a valid Prisma client for
testing: when the client has not been generated the library throws
because it requires the Prisma.dmmf object to exist. A benefit of having
a generated client for testing is that we can leverage the generated
types to ensure the params being used in the tests are valid.

Now that we have @prisma/client in the development setup we can use the
official types in the main lib, they won't be used at build time but we
can check the types when the development deps are installed. Change the
@ts-expect-error above the import of the prisma client to @ts-ignore
since during development we no longer expect an error.

There is one failing test that has revealed a legitimate bug in
modifying deeply nested results. That test has been marked as failing so
it does not fail builds.
@olivierwilkinson olivierwilkinson marked this pull request as ready for review January 8, 2023 00:01
@olivierwilkinson olivierwilkinson merged commit b846d29 into main Jan 8, 2023
@olivierwilkinson olivierwilkinson deleted the tests branch January 8, 2023 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants