From f45b0f6afc4654295e86f2abf5b728be317aefe4 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Sun, 22 Nov 2026 00:06:30 +0700 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D0=B2=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D0=B5=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D0=B8=20?= =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=20backend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/scripts/test.mjs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/scripts/test.mjs b/backend/scripts/test.mjs index f0e9c59c..fb254b1a 100644 --- a/backend/scripts/test.mjs +++ b/backend/scripts/test.mjs @@ -3,10 +3,13 @@ import { spawnSync } from "node:child_process" const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")) const npmCli = process.env.npm_execpath if (!npmCli) throw new Error("Запускайте тесты через npm --prefix backend test") -for (const command of pkg.scripts["test:all"].split(/\s*&&\s*/)) { - const match = /^npm run (test:[\w-]+)$/.exec(command) - if (!match) throw new Error("Неизвестный формат профиля backend tests") - const result = spawnSync(process.execPath, [npmCli, "run", match[1]], { +const profiles = pkg.scripts["test:all"].split(/\s*&&\s*/).map(command => { + const match = /^npm run (test:[\w-]+(?::[\w-]+)*)$/.exec(command) + if (!match || !Object.hasOwn(pkg.scripts, match[1])) throw new Error(`Неизвестный профиль тестов backend: ${command}`) + return match[1] +}) +for (const profile of profiles) { + const result = spawnSync(process.execPath, [npmCli, "run", profile], { cwd: new URL("../", import.meta.url), env: { ...process.env, NODE_ENV: "test" }, stdio: "inherit",