Skip to content

Commit

Permalink
tests: Use a fake HTTP context when using executeOperation.
Browse files Browse the repository at this point in the history
This resolves a number of runtime errors which surfaced in the test suite
for this repository, appearing as:

  TypeError: Cannot read property 'method' of undefined

This was overlooked or not addressed within #158 / #246.

While not ideal, today, Apollo Server has a very real expectation of an HTTP
request context.  That will change in the future.  While we can sometimes
make by without it, that is no longer the case when Engine Reporting is
enabled since it relies on the HTTP "method" property of the HTTP context
when building the traces.  Therefore, we'll need to make sure that we
provide a fake HTTP context to `executeOperation` when testing with Engine
enabled, to ensure that it doesn't fail.

cc @jsegaran
  • Loading branch information
abernix committed Mar 19, 2020
1 parent 6ad6c90 commit 6617f68
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 6617f68

Please sign in to comment.