refactor(core-testing): no-sentry → no-instrumentation (mocks OTel too)

This commit is contained in:
2026-05-11 12:14:18 +02:00
parent bd95315a44
commit 8bedb649ca
5 changed files with 50 additions and 9 deletions

View File

@@ -0,0 +1,16 @@
import { describe, it, expect, vi } from "vitest";
import * as Sentry from "@sentry/nextjs";
describe("setup/no-instrumentation guard (R49)", () => {
it("Sentry.init is a vi.fn (mocked, not real)", () => {
expect(vi.isMockFunction(Sentry.init)).toBe(true);
});
it("Sentry.captureException is a vi.fn", () => {
expect(vi.isMockFunction(Sentry.captureException)).toBe(true);
});
it("calling Sentry.init does not throw or initialize", () => {
expect(() => Sentry.init({ dsn: "https://x@y/1" } as Parameters<typeof Sentry.init>[0])).not.toThrow();
});
});