Files
sprites/tools/build/test/exec.test.ts
Christopher Monsanto 3ec1abad12 Write let instead of const
Per the house rule, const survives only where TypeScript hangs
behavior off the spelling: the <const T> type parameter in rule()
and the as const option tables.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 01:13:14 -04:00

17 lines
575 B
TypeScript

import assert from 'node:assert/strict';
import {test} from 'node:test';
import {runShell} from '../exec.ts';
test('runShell runs && chains from stdin and reports exit status', async () => {
let signal = new AbortController().signal;
let ok = await runShell('echo one && echo two', {cwd: process.cwd(), signal});
assert.equal(ok.code, 0);
assert.equal(ok.output, 'one\ntwo\n');
let bad = await runShell('echo partial && false && echo never', {cwd: process.cwd(), signal});
assert.equal(bad.code, 1);
assert.equal(bad.output, 'partial\n');
});