Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/apps/web/app/entry.client.test.ts
T

24 lines
1.1 KiB
TypeScript

import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import path from "node:path";
import { describe, expect, test } from "vitest";
const entrySource = readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "entry.client.tsx"), "utf8");
describe("entry.client hydration contract", () => {
test("starts hydration immediately while observability initializes in parallel", () => {
expect(entrySource).toContain("void initClientObservability().catch");
expect(entrySource).toContain("hydrate();");
expect(entrySource).not.toContain("requestIdleCallback(hydrate)");
expect(entrySource).not.toContain("waitForObservabilityHydrationGrace");
expect(entrySource).not.toContain("OBSERVABILITY_HYDRATION_GRACE_MS");
});
test("uses revisioned locale assets without disabling the browser cache", () => {
expect(entrySource).toContain("publicEnv.VITE_APP_REVISION || publicEnv.VITE_SENTRY_RELEASE");
expect(entrySource).toContain("?v=${encodeURIComponent(localeAssetVersion)}");
expect(entrySource).not.toContain('requestOptions: { cache: "no-store" }');
});
});