New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add createTestClient #1104
Add createTestClient #1104
Conversation
feat: Use createTestClient in code-first-federation.spec.ts feat: Use createTestClient in code-first.spec.ts
Thanks for your contribution! I've left a few minor comments |
Co-authored-by: Kamil Mysliwiec <mail@kamilmysliwiec.com>
refactor: Move createTestClient to tests/utils
Thank you @kamilmysliwiec for your review, I've updated the code. If you can, I would like your input about these open questions:
|
Up to you :) It would be nice to have them consistent though
Good question. Perhaps, we could just add another section here https://docs.nestjs.com/fundamentals/testing? |
If it's okay I'll rather not do it right now as I'm really busy. If I'll have the time I'll create another PR later.
I think that would do, though maybe it's better to mention it in the GraphQL documentation? I don't have a strong opinion on this... |
Co-authored-by: Kamil Mysliwiec <mail@kamilmysliwiec.com>
Ready to merge? |
@kamilmysliwiec anything left to do? |
The tools provided by this PR would be useful to me ! |
I can't wait for it to be merged. Great work @iddan |
Thanks! This will be added in the incoming release |
Motivation for this update: @nestjs/graphql 7.8.0 adds getApolloServer, which is needed for things like apollo-server-testing's createTestClient. * nestjs/graphql#1101 * nestjs/graphql#1104 * https://github.com/nestjs/graphql/releases/tag/7.8.0 Note: This directly updates the same packages that "yarn nest update" updates, though "nest update" doesn't work with Yarn 2 yet. Invocation (for reference): yarn up @nestjs/common @nestjs/config @nestjs/core @nestjs/graphql @nestjs/mongoose @nestjs/passport @nestjs/platform-express @nestjs/terminus yarn dedupe
Motivation for this update: @nestjs/graphql 7.8.0 adds getApolloServer, which is needed for things like apollo-server-testing's createTestClient. * nestjs/graphql#1101 * nestjs/graphql#1104 * https://github.com/nestjs/graphql/releases/tag/7.8.0 Note: This directly updates the same packages that "yarn nest update" updates, though "nest update" doesn't work with Yarn 2 yet. Invocation (for reference): yarn up @nestjs/common @nestjs/config @nestjs/core @nestjs/graphql @nestjs/mongoose @nestjs/passport @nestjs/platform-express @nestjs/terminus yarn dedupe
Motivation for this update: @nestjs/graphql 7.8.0 adds getApolloServer, which is needed for things like apollo-server-testing's createTestClient. * nestjs/graphql#1101 * nestjs/graphql#1104 * https://github.com/nestjs/graphql/releases/tag/7.8.0 Note: This directly updates the same packages that "yarn nest update" updates, though "nest update" doesn't work with Yarn 2 yet. Invocation (for reference): yarn up @nestjs/common @nestjs/config @nestjs/core @nestjs/graphql @nestjs/mongoose @nestjs/passport @nestjs/platform-express @nestjs/terminus yarn dedupe
It's not part of the build when it's installed? |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
GraphQL tests are done using supertest.
What is the new behavior?
GraphQL tests are done using apollo-server-testing
Does this PR introduce a breaking change?
Other information
Resolves: #1101