feat(admin): add production error center and refresh CMS dependencies
This commit is contained in:
1 parent
c6b919c01d
commit
816e3875c2
47 files changed
+1545
-547
No files matched your search
@@ -1,10 +1,14 @@
|
||||
import { createRequire } from "node:module";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { expect, it } from "vitest";
|
||||
import { createErrorRecord } from "./error-monitor";
|
||||
|
||||
describe("observability dependency contract", () => {
|
||||
it("does not ship the Sentry SDK", () => {
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
expect(() => require.resolve("@sentry/nextjs")).toThrow();
|
||||
});
|
||||
it("captures diagnostic data without serializing arbitrary request bodies", () => {
|
||||
const record = createErrorRecord(
|
||||
"server",
|
||||
"request.failed",
|
||||
new Error("failure"),
|
||||
{ body: { password: "secret" }, path: "/admin/studio" },
|
||||
);
|
||||
expect(record.context.body).toBe("[REDACTED]");
|
||||
expect(record.context.path).toBe("/admin/studio");
|
||||
expect(record.stack).toContain("failure");
|
||||
});
|
||||
Reference in new issue
Block a user