21 lines
1.4 KiB
TypeScript
21 lines
1.4 KiB
TypeScript
// PEP-144: the live site runs `next dev`; anything a browser tab makes the dev server write under
|
|
// .next is picked up as a change and every open page refreshes in a loop.
|
|
import assert from "node:assert/strict";
|
|
import { describe, test } from "node:test";
|
|
|
|
// Loaded by URL: a static import would pull Next's global types (ProcessEnv) into this package.
|
|
type DevConfig = { experimental?: { mcpServer?: boolean }; logging?: false | { browserToTerminal?: unknown } };
|
|
const config = ((await import(new URL("../../../apps/web/next.config.ts", import.meta.url).href)) as { default: DevConfig }).default;
|
|
|
|
describe("PEP-144: открытая страница не вызывает пересборку", () => {
|
|
test("Настройку убрали из конфига: experimental.mcpServer выключен — файла журнала .next/dev/logs нет", () => {
|
|
assert.equal(config.experimental?.mcpServer, false, "experimental.mcpServer must stay false in apps/web/next.config.ts");
|
|
});
|
|
|
|
test("Вкладка открыта на живом сайте: журнал браузера не пересылается серверу разработки", () => {
|
|
const logging = config.logging;
|
|
assert.ok(logging && typeof logging === "object", "logging must be set in apps/web/next.config.ts");
|
|
assert.equal(logging.browserToTerminal, false, "logging.browserToTerminal must stay false in apps/web/next.config.ts");
|
|
});
|
|
});
|