Skip to content

Feature request: allow overriding ignoredRoutes in getTestServer() #778

Description

@caugner

getTestServer() hard-codes ignoredRoutes: null, which re-enables the default /favicon.ico and /robots.txt 404 short-circuit for HTTP functions. There's no way for a test to reproduce a production deployment that disables it via --ignored-routes "", so functions that legitimately serve those paths can't be tested through getTestServer().

Proposal: accept an optional options bag that overrides the getServer options (starting with ignoredRoutes), defaulting to today's behavior:

const server = getTestServer('myFn', {ignoredRoutes: ''});

Backward compatible since the parameter is optional. ignoredRoutes is the immediate need; a general options bag would also cover timeoutMilliseconds etc.

Version: @google-cloud/functions-framework 5.0.5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions