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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions