From 993be21ba8b14bed528cf645fc06eb06f0a6744f Mon Sep 17 00:00:00 2001 From: Peppa Date: Tue, 17 Nov 2026 22:39:25 +0500 Subject: [PATCH] =?UTF-8?q?BRM-104:=20=D1=82=D0=B5=D1=81=D1=82=20BRM-87=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D1=91=D1=82=20=D0=B0=D0=B4=D1=80=D0=B5?= =?UTF-8?q?=D1=81=20=D1=81=D0=B0=D0=BC,=20=D0=B0=20=D0=BD=D0=B5=20=D0=B1?= =?UTF-8?q?=D0=B5=D1=80=D1=91=D1=82=20=D0=B8=D0=B7=20=D0=BE=D0=BA=D1=80?= =?UTF-8?q?=D1=83=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- test/site-mail.test.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/site-mail.test.js b/test/site-mail.test.js index f1b5ca3..1fa0213 100644 --- a/test/site-mail.test.js +++ b/test/site-mail.test.js @@ -1,10 +1,11 @@ import test from "node:test"; import assert from "node:assert/strict"; -import { pageHtml } from "../src/site.js"; +import { execFileSync } from "node:child_process"; +// BRM-104: адрес задаётся явно — без CONTACT_EMAIL ссылки на почту нет вовсе (test/contact.test.js). test("BRM-87: адрес на «Рынке» и главной не прячется от посетителя", () => { - for (const f of ["market.html"]) { - const h = pageHtml(f, "ru"); - assert.match(h, /[^<@]+@[^<@]+<\/a>/); - } + const h = execFileSync(process.execPath, ["--input-type=module", "-e", + `import { homePage, pageHtml } from "./src/site.js"; process.stdout.write(JSON.stringify([pageHtml("market.html", "ru"), homePage("ru")]));`], + { env: { PATH: process.env.PATH, CONTACT_EMAIL: "hello@brand.example" }, encoding: "utf8" }); + for (const page of JSON.parse(h)) assert.match(page, /[^<@]+@[^<@]+<\/a>/); });