refactor(core-testing): no-sentry → no-instrumentation (mocks OTel too)
This commit is contained in:
16
packages/core-testing/src/setup/no-instrumentation.test.ts
Normal file
16
packages/core-testing/src/setup/no-instrumentation.test.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user