Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Use a fake HTTP context when using
executeOperation
.
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