[Testing] Cannot use e2e test with GraphQL in 5.3.4
See original GitHub issueI’m submitting a…
[x] Regression
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
When I run e2e tests on my app with a GraphQLModule, tests fails as described in https://github.com/nestjs/graphql/issues/58
FAIL e2e/app.e2e-spec.ts (6.848s)
e2e
/graphql
✕ Pagination (6ms)
● AppController (e2e) › /graphql Pagination
TypeError: this.httpServer.getInstance is not a function
at GraphQLModule.<anonymous> (node_modules/@nestjs/graphql/dist/graphql.module.js:134:35)
at node_modules/@nestjs/graphql/dist/graphql.module.js:59:69
at Object.<anonymous>.__awaiter (node_modules/@nestjs/graphql/dist/graphql.module.js:37:12)
at GraphQLModule.onModuleInit (node_modules/@nestjs/graphql/dist/graphql.module.js:132:12)
at NestApplication.callModuleInitHook (node_modules/@nestjs/core/nest-application-context.js:66:39)
you can find a sample with a failing test here: https://github.com/cyril-lakech/nest/tree/test/e2eGraphQL/sample/12-graphql-apollo
Expected behavior
e2e tests working fine as with version 5.1 ^^
Environment
Nest version: 5.3.4
"@nest-middlewares/helmet": "^5.1.0",
"@nestjs/common": "^5.3.5",
"@nestjs/core": "^5.3.4",
"@nestjs/graphql": "^5.1.2",
"@nestjs/microservices": "^5.3.5",
"@nestjs/swagger": "^2.5.1",
"@nestjs/testing": "^5.3.1",
"@nestjs/websockets": "^5.3.1"
For Tooling issues:
- Node version: 8.11
- Platform: Mac
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Integration testing - Apollo GraphQL Docs
There are two main options for integration testing with Apollo Server: Using ApolloServer 's executeOperation method. Setting up an HTTP client to query...
Read more >Testing | Webiny Docs
End-to-End (E2E) Tests Some examples are testing a GraphQL API or when talking about frontend development, simulating a user completing a signup form....
Read more >How Test e2e Nestjs API with GRAPHQL - Stack Overflow
My problem was from CLI plugin which generate automatically nullable Graphql fields without putting the @Field decorator in my ObjectType.
Read more >AutoGraphQL: An automated test generation tool for GraphQL
This thesis presents a novel technique to automatically generate test cases that assess the implementation of a GraphQL API. The key conceptual foundation....
Read more >An E2E test scenario in NestJS for a GraphQL mutation - Selleo
A function to set up the app for the E2E's test suite: // Location: test/utils/create-testing-module.ts import { Test } from '@nestjs/testing' import ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m on it. Let’s track this issue here https://github.com/nestjs/graphql/issues/58
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.