From 6617f68741d4c30990a08f644ded0eed521cebde Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Thu, 19 Mar 2020 16:56:52 +0200 Subject: [PATCH] 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