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.
getTestServer()hard-codesignoredRoutes: null, which re-enables the default/favicon.icoand/robots.txt404 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 throughgetTestServer().Proposal: accept an optional options bag that overrides the
getServeroptions (starting withignoredRoutes), defaulting to today's behavior:Backward compatible since the parameter is optional.
ignoredRoutesis the immediate need; a general options bag would also covertimeoutMillisecondsetc.Version:
@google-cloud/functions-framework5.0.5.