Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const healthcheckSourcePath = path.join(path.dirname(fileURLToPath(import.meta.url)), "./healthcheck.tsx");
|
||||
const healthcheckSource = () => readFileSync(healthcheckSourcePath, "utf8");
|
||||
|
||||
describe("web healthcheck route diagnostics", () => {
|
||||
it("keeps the legacy healthcheck route as cheap liveness only", () => {
|
||||
const source = healthcheckSource();
|
||||
|
||||
expect(source).toContain('new Response("OK")');
|
||||
expect(source).not.toContain("~/utils/db.server");
|
||||
expect(source).not.toContain("db.appConfiguration.count");
|
||||
expect(source).not.toContain("fetch(");
|
||||
expect(source).not.toContain("X-Forwarded-Host");
|
||||
});
|
||||
|
||||
it("does not leave active console diagnostics in the healthcheck route", () => {
|
||||
const source = healthcheckSource();
|
||||
const withoutLineComments = source.replaceAll(/\/\/.*$/gm, "");
|
||||
|
||||
expect(withoutLineComments).not.toMatch(/\bconsole\.(?:log|error|warn|info)\s*\(/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user