Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { requireWebLogIdentity } from "./logger.server";
|
||||
|
||||
describe("web logger runtime identity", () => {
|
||||
it.each([
|
||||
["core", "hivegrid-web"],
|
||||
["admin", "hivegrid-admin"],
|
||||
["portal", "hivegrid-portal"],
|
||||
] as const)("maps %s to service=%s", (surface, service) => {
|
||||
expect(requireWebLogIdentity({ WEB_RUNTIME_SURFACE: surface })).toEqual({ service, surface });
|
||||
});
|
||||
|
||||
it("fails closed outside tests when the runtime surface is missing or invalid", () => {
|
||||
expect(() => requireWebLogIdentity({ NODE_ENV: "production", WEB_RUNTIME_SURFACE: undefined })).toThrow(
|
||||
"WEB_RUNTIME_SURFACE must be explicitly set to core, admin, or portal"
|
||||
);
|
||||
expect(() => requireWebLogIdentity({ NODE_ENV: "production", WEB_RUNTIME_SURFACE: "customer" })).toThrow(
|
||||
"WEB_RUNTIME_SURFACE must be explicitly set to core, admin, or portal"
|
||||
);
|
||||
});
|
||||
|
||||
it("uses an explicit Core fallback for test tooling only", () => {
|
||||
expect(requireWebLogIdentity({ NODE_ENV: "test", WEB_RUNTIME_SURFACE: undefined })).toEqual({ service: "hivegrid-web", surface: "core" });
|
||||
expect(() => requireWebLogIdentity({ NODE_ENV: "test", WEB_RUNTIME_SURFACE: "customer" })).toThrow(
|
||||
"WEB_RUNTIME_SURFACE must be explicitly set to core, admin, or portal"
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user