The TypeScript template repository for Cloudflare Workers has a test for mocking a GET request whereby Request is instantiated to mock the input parameters for handleRequest.
However, I've since modified the template to pass the raw FetchEvent to the handleRequest method, rather than FetchEvent.request (which is the default). Now, I need to instantiate FetchEvent in my test for passing to handleRequest, rather than Request.
Where can I import FetchEvent from? My first thought was to add node-fetch as a dev dependency, but it looks like that library doesn't provide a FetchEvent implementation.
Is there a way of mocking the FetchEvent without needing to resort to another external dependency (i.e. within the Cloudflare Workers library)?