mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 08:23:59 +01:00
test: drop the helper-only Capy host fixture test (test-of-test ratchet); lane tests exercise the helper
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
4d7545d2c9
commit
30d3a68e50
1 file changed
-24
@@ -1,24 +0,0 @@
|
||||
/**
|
||||
* The shared simulated Capy host (test/helpers/capy-host.ts) has the field
|
||||
* shape: the PATH Bun reports 1.3.14, no codex resolves, the verified Bun in
|
||||
* $HOME/.bun/bin is off PATH, and the launch PATH puts it first.
|
||||
*/
|
||||
import { afterEach, describe, expect, test } from 'bun:test';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { capyHost, type CapyHost } from './helpers/capy-host';
|
||||
|
||||
const hosts: CapyHost[] = [];
|
||||
afterEach(() => { for (const h of hosts.splice(0)) h.cleanup(); });
|
||||
const sh = (h: CapyHost, cmd: string, pathOverride?: string) =>
|
||||
spawnSync('bash', ['-c', cmd], { cwd: h.home, encoding: 'utf8', env: { ...h.env, ...(pathOverride ? { PATH: pathOverride } : {}) } });
|
||||
|
||||
describe('simulated Capy host', () => {
|
||||
test('PATH Bun is 1.3.14, codex is absent, the verified Bun is only on the launch PATH', () => {
|
||||
const h = capyHost({ verifiedBun: '1.4.2' }); hosts.push(h);
|
||||
expect(sh(h, 'bun --version').stdout.trim()).toBe('1.3.14');
|
||||
expect(sh(h, 'command -v codex || echo none').stdout.trim()).toBe('none');
|
||||
expect(sh(h, 'command -v bun').stdout.trim()).toBe(`${h.systemBin}/bun`);
|
||||
expect(sh(h, 'bun --version', h.launchPath).stdout.trim()).toBe('1.4.2');
|
||||
expect(sh(h, 'bun -e "console.log(1+1)"').stdout.trim()).toBe('2');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user