Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import { describe, expect, it,} from '@monochromatic-dev/module-test/ts';import { evaluatePredicate, } from './evaluate-predicate.ts';
//region Predicates
await describe({ name: evaluatePredicate.name, children: [ it({ name: 'returns true for a command that exits 0', fn: async () => { /** `true` binary always exits 0 */ const result = await evaluatePredicate(['true',],); expect(result,).toBe(true,); }, },), it({ name: 'returns false for a command that exits non-zero', fn: async () => { /** `false` binary always exits 1 */ const result = await evaluatePredicate(['false',],); expect(result,).toBe(false,); }, },), it({ name: 'passes arguments to the command', fn: async () => { /** `ls` with a known path exits 0 */ const result = await evaluatePredicate(['ls', '/dev/null',],); expect(result,).toBe(true,); }, },), it({ name: 'returns false for a nonexistent command', fn: async () => { /** A command that does not exist should fail gracefully */ const result = await evaluatePredicate(['nonexistent-command-abc123',],); expect(result,).toBe(false,); }, },), ],},);
//endregion Predicates