Skip to content

Commit 60c3833

Browse files
committed
Respond to review: update tests and add a changelog entry
1 parent 81c72af commit 60c3833

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixes an issue where the `--only` flag was not always respected for `firebase mcp`

src/mcp/prompts/index.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ describe("availablePrompts", () => {
5050

5151
it("should include feature-specific prompts when activeFeatures is provided", async () => {
5252
const prompts = await availablePrompts(mockContext, ["crashlytics"]);
53-
const crashPrompt = prompts.find((p) => p.mcp._meta?.feature === "crashlytics");
5453

55-
// Should exist because we bypass availability check
56-
expect(crashPrompt).to.exist;
54+
const features = [...new Set(prompts.map((p) => p.mcp._meta?.feature))];
55+
expect(features).to.have.members(["core", "crashlytics"]);
5756

5857
// getDefaultFeatureAvailabilityCheck execution is deferred/lazy-loaded in prompt.ts
5958
// Since activeFeatures bypasses checking .isAvailable on the prompt, the stub should NOT be called.
@@ -71,9 +70,8 @@ describe("availablePrompts", () => {
7170
getDefaultFeatureAvailabilityCheckStub.withArgs("crashlytics").returns(async () => true);
7271

7372
const prompts = await availablePrompts(mockContext, [], ["crashlytics"]);
74-
const crashPrompt = prompts.find((p) => p.mcp._meta?.feature === "crashlytics");
75-
76-
expect(crashPrompt).to.exist;
73+
const features = [...new Set(prompts.map((p) => p.mcp._meta?.feature))];
74+
expect(features).to.have.members(["core", "crashlytics"]);
7775

7876
// Fallback logic calls isAvailable(), which invokes our lazy check, calling getDefault...
7977
expect(getDefaultFeatureAvailabilityCheckStub.called).to.be.true;

0 commit comments

Comments
 (0)