From 7be52212082a8f76a17ab2da381269c0abce5fb5 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 18:00:01 +0000 Subject: [PATCH] fix(test): Fix strict-type and lint errors that broke main CI #2387 and #2403 landed tests written before the strict TypeScript and lint policy from #2266, so main fails typecheck in mcp-core and mcp-cloudflare and the repository lint. Narrow the fixture lookup with assert, use bracket access for the metadata index signature, and drop the unneeded non-null assertion and unawaited return. Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com> --- .../authorization-server-metadata.integration.test.ts | 10 +++++----- .../src/internal/update-issue-side-quests.test.ts | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/mcp-cloudflare/src/server/authorization-server-metadata.integration.test.ts b/packages/mcp-cloudflare/src/server/authorization-server-metadata.integration.test.ts index 924a43752..b025c7d7e 100644 --- a/packages/mcp-cloudflare/src/server/authorization-server-metadata.integration.test.ts +++ b/packages/mcp-cloudflare/src/server/authorization-server-metadata.integration.test.ts @@ -9,13 +9,13 @@ const workerEnv = { } as Env; async function fetchMetadata(path: string): Promise> { - const response = await handler.fetch!( + const response = await handler.fetch( new Request(`https://mcp.sentry.dev${path}`), workerEnv, createExecutionContext(), ); expect(response.status).toBe(200); - return response.json(); + return await response.json(); } describe("authorization server metadata", () => { @@ -27,9 +27,9 @@ describe("authorization server metadata", () => { "/.well-known/oauth-authorization-server/mcp/sentry/mcp-server", ); - expect(root.code_challenge_methods_supported).toEqual(["S256"]); - expect(scoped.code_challenge_methods_supported).toEqual( - root.code_challenge_methods_supported, + expect(root["code_challenge_methods_supported"]).toEqual(["S256"]); + expect(scoped["code_challenge_methods_supported"]).toEqual( + root["code_challenge_methods_supported"], ); }); }); diff --git a/packages/mcp-core/src/internal/update-issue-side-quests.test.ts b/packages/mcp-core/src/internal/update-issue-side-quests.test.ts index e74088e4f..723ceff57 100644 --- a/packages/mcp-core/src/internal/update-issue-side-quests.test.ts +++ b/packages/mcp-core/src/internal/update-issue-side-quests.test.ts @@ -1,6 +1,6 @@ import { getActiveSpan } from "@sentry/core"; import { relatedIssuesFixture } from "@sentry/mcp-server-mocks"; -import { describe, expect, it, vi } from "vitest"; +import { assert, describe, expect, it, vi } from "vitest"; import { RelatedIssuesResponseSchema } from "../api-client/schema"; import { RELATED_ISSUES_LIMIT, @@ -81,6 +81,7 @@ describe("buildUpdateIssueSideQuests", () => { const attributes = captureSpanAttributes(); const related = relatedIssues(); const [, open] = related.data; + assert(open, "Expected the fixture's unresolved related issue"); related.data = Array.from({ length: 4 }, (_, index) => ({ ...open, issue: { ...open.issue, shortId: `WEB-${index + 1}` },