question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Testing] Cannot use e2e test with GraphQL in 5.3.4

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilmysliwieccommented, Sep 9, 2018

I’m on it. Let’s track this issue here https://github.com/nestjs/graphql/issues/58

0reactions
lock[bot]commented, Sep 24, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found