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,32 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getWebBuildDirectory, getWebServiceName, getWebTestBuildSurfaceFallback, requireWebBuildSurface } from "./build-surface";
|
||||
|
||||
describe("web build surface", () => {
|
||||
it.each([
|
||||
["core", "build"],
|
||||
["admin", "build"],
|
||||
["portal", "build-portal"],
|
||||
] as const)("maps %s to its isolated build directory", (surface, directory) => {
|
||||
expect(requireWebBuildSurface({ HIVEGRID_RUNTIME_SURFACE: surface })).toBe(surface);
|
||||
expect(getWebBuildDirectory(surface)).toBe(directory);
|
||||
});
|
||||
|
||||
it("maps each surface to a distinct observability service", () => {
|
||||
expect(getWebServiceName("core")).toBe("hivegrid-web");
|
||||
expect(getWebServiceName("admin")).toBe("hivegrid-admin");
|
||||
expect(getWebServiceName("portal")).toBe("hivegrid-portal");
|
||||
});
|
||||
|
||||
it.each([undefined, "", "customer"])("fails closed for invalid surface %s", (surface) => {
|
||||
expect(() => requireWebBuildSurface({ HIVEGRID_RUNTIME_SURFACE: surface })).toThrow(
|
||||
"HIVEGRID_RUNTIME_SURFACE must be explicitly set to core, admin, or portal"
|
||||
);
|
||||
});
|
||||
|
||||
it("allows an explicit Core fallback for test tooling only", () => {
|
||||
expect(requireWebBuildSurface({ HIVEGRID_RUNTIME_SURFACE: undefined }, "core")).toBe("core");
|
||||
expect(getWebTestBuildSurfaceFallback({ NODE_ENV: "test", VITEST: undefined }, [])).toBe("core");
|
||||
expect(getWebTestBuildSurfaceFallback({ NODE_ENV: "production", VITEST: undefined }, ["node", "/bin/server.js"])).toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user