Case com mídia ao lado do título e play acessível; problema de cada cliente reescrito com base nos dados; serviços relacionados em 2 cards; FAQ antes do próximo passo e bloco 'Onde já apliquei isso'; Apolo citada em IoT e arquitetura. metaTitle até 43 caracteres e descrições até 155 com teste; JSON-LD CreativeWork; imagens de compartilhamento abaixo de 100 KB; 404 e robots corrigidos; server-only nos módulos com node:.
30 lines
953 B
TypeScript
30 lines
953 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { siteUrl } from "@/lib/site-content";
|
|
import robots from "./robots";
|
|
|
|
describe("robots", () => {
|
|
it("allows everything, points to the sitemap at the site address and lists no route that does not exist", () => {
|
|
expect(robots()).toEqual({
|
|
rules: [
|
|
{
|
|
userAgent: "*",
|
|
allow: ["/", "/_next/static/", "/_next/image/"],
|
|
},
|
|
],
|
|
sitemap: `${siteUrl}/sitemap.xml`,
|
|
});
|
|
});
|
|
|
|
it("has no host (Yandex only, deprecated) and blocks no /api/ or /admin/", () => {
|
|
const result = robots();
|
|
expect(result).not.toHaveProperty("host");
|
|
expect(JSON.stringify(result)).not.toMatch(/\/api\/|\/admin\/|disallow/i);
|
|
});
|
|
|
|
it("is saved without a byte order mark", () => {
|
|
const bytes = readFileSync(join(__dirname, "robots.ts"));
|
|
expect([...bytes.subarray(0, 3)]).not.toEqual([0xef, 0xbb, 0xbf]);
|
|
});
|
|
});
|