Skip to content

TestingOperation.flush expected enum but receive type in graphql:15 #2324

Closed
@magik9907

Description

@magik9907

Describe the bug
While running tests for the versions listed below, the tests are failing with the error: Cannot read properties of undefined (reading 'SUBSCRIPTION').

Fail location in:

  • class TestOperation ,
  • method: flush,
  • line: 29

Code fragment where it's failed:

if (
    definition.kind === Kind.OPERATION_DEFINITION &&
    definition.operation !== OperationTypeNode.SUBSCRIPTION // <-- PROBLEM
  ) {
    this.complete();
  }

Reference:

Solution that worked:
After updating graphql to version 16, the tests are now passing

To Reproduce

Steps to reproduce the behavior:
Run test with dependencie version shown below.

Expected behavior

  • while installing packages, npm should show information with incompatible version for graphql:15.x.x and apollo-angular:8.*.*
    OR
  • while running tests with graphql:15.x.x and apollo-angular:8.*.*, they should passed

Environment:

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions