Files
pbakaus_impeccable/tests/target-args.test.mjs
T
Abdul WahabandGitHub 0306b41949 Add monorepo context support (#213)
Context files (PRODUCT.md / DESIGN.md) resolve child-first then fall back to the repo root, and /impeccable live lets the user pick a child app in a monorepo. Single-app behavior is unchanged. Closes #202. Co-Authored-By: abdulwahabone
2026-06-20 19:49:37 +09:00

21 lines
760 B
JavaScript

import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { parseTargetPath } from '../skill/scripts/lib/target-args.mjs';
describe('target argument helpers', () => {
it('uses the last target value when duplicate target flags are present', () => {
assert.equal(
parseTargetPath(['--target', 'apps/marketing/src/App.jsx', '--target=apps/dashboard/src/App.jsx']),
'apps/dashboard/src/App.jsx',
);
});
it('throws a small target-arg error for missing target values in strict mode', () => {
assert.throws(
() => parseTargetPath(['--target', '--help'], { strict: true }),
(err) => err.code === 'TARGET_VALUE_MISSING' && /--target requires a path value/.test(err.message),
);
});
});