GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs

Feature request: allow overriding `ignoredRoutes` in `getTestServer()`

オープン 初心者向け
#778 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
feature request P2
主要言語
TypeScript
スター
1.4k
フォーク
181
PR マージ指標
30日以内にマージされた PR はありません

説明

`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:

```ts
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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Locate the getTestServer() entry point and inspect how it calls getServer(), focusing on the hard-coded ignoredRoutes option. Add the optional options bag described in the issue, preserve today’s default behavior, and verify that ignoredRoutes can be overridden while existing calls remain compatible.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
nodejs, typescript
領域
backend, testing
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。