17 lines
627 B
TypeScript
17 lines
627 B
TypeScript
// @vitest-environment node
|
|
import { describe, expect, it } from "vitest";
|
|
import { shouldNoindex, X_ROBOTS_TAG_NOINDEX } from "./noindex.server";
|
|
|
|
describe("AK-INFRA1 noindex gating", () => {
|
|
it("noindexes only when WEB_NOINDEX is exactly 'true'", () => {
|
|
expect(shouldNoindex({ WEB_NOINDEX: "true" })).toBe(true);
|
|
expect(shouldNoindex({ WEB_NOINDEX: "false" })).toBe(false);
|
|
expect(shouldNoindex({ WEB_NOINDEX: "1" })).toBe(false);
|
|
expect(shouldNoindex({})).toBe(false);
|
|
});
|
|
|
|
it("uses a standard noindex,nofollow tag value", () => {
|
|
expect(X_ROBOTS_TAG_NOINDEX).toBe("noindex, nofollow");
|
|
});
|
|
});
|