From 5d0fdc4c0dfea734dcae91fffd7723200dc06b57 Mon Sep 17 00:00:00 2001 From: Andrey Epifancev Date: Sat, 24 Oct 2026 19:22:08 +0400 Subject: [PATCH] =?UTF-8?q?fix(dsh):=20=D1=82=D0=B5=D1=81=D1=82=20--check?= =?UTF-8?q?=20=D0=B1=D0=B5=D0=B7=20openspec=20=D0=B8=D1=89=D0=B5=D1=82=20b?= =?UTF-8?q?ash=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D1=81=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D0=B5=D0=BC=D0=BD=D1=8B=D0=B9=20PATH=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: DeepSeek Harness --- dsh/tests/openspec.test.mjs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dsh/tests/openspec.test.mjs b/dsh/tests/openspec.test.mjs index 1399f34..0d1982b 100644 --- a/dsh/tests/openspec.test.mjs +++ b/dsh/tests/openspec.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { spawnSync } from 'node:child_process' -import { chmodSync, existsSync, readFileSync } from 'node:fs' +import { chmodSync, existsSync, mkdirSync, readFileSync, symlinkSync } from 'node:fs' import { dirname, join } from 'node:path' import test from 'node:test' import { fileURLToPath } from 'node:url' @@ -50,10 +50,18 @@ test('install.sh --check warns but does not fail without the openspec CLI', () = const home = tempDir() try { const bin = join(home, 'bin') - const env = { ...process.env, HOME: home, DSH_HOME: join(home, '.dsh'), PATH: bin } + mkdirSync(bin, { recursive: true }) + symlinkSync(process.execPath, join(bin, 'node')) + // openspec ставится в /opt/homebrew/bin; здесь только системные каталоги — CLI не найден + const env = { + ...process.env, + HOME: home, + DSH_HOME: join(home, '.dsh'), + PATH: `${bin}:/usr/bin:/bin:/usr/sbin:/sbin`, + } const run = spawnSync('bash', [script, '--check'], { env, encoding: 'utf8' }) + assert.equal(run.status, 0, run.stderr) assert.match(run.stdout + run.stderr, /WARN: openspec not found/) - assert.equal(run.status, 0) } finally { cleanup(home) }