Commit fb2b88a
committed
test: add vitest with coverage for non-interactive agentic flow
Test suite (91 tests) focused on the agent-facing interface:
- nonInteractive: flag validation (missing/invalid name, mode, features),
full-mode execution (operation order, all features in output, postInstall),
custom-mode execution (feature selection, partial postInstall),
edge cases (empty features, trailing commas, whitespace trimming),
error handling (operation failures produce JSON errors),
JSON output format (parseable, required fields, absolute path)
- info: JSON structure, all features present with description/default,
postInstall conditional, no internal fields leaked, modes present
- operations: cloneRepo (5-step sequence, execFile for user input,
exec only for shell substitution, no projectName in shell strings),
createEnvFile (correct cp command and cwd),
installPackages (full/custom/all-selected modes, pnpm remove with
correct packages, postinstall after remove, selected packages excluded),
cleanupFiles (full-mode no-op, per-feature file removal, subgraph
compound condition, package.json script patching, .install-files last)
- utils: isValidName, isFeatureSelected, getPackagesToRemove,
getPostInstallMessages
Coverage: nonInteractive 95%, info/config/all operations 100%.1 parent eef5a61 commit fb2b88a
12 files changed
Lines changed: 1928 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
34 | 37 | | |
35 | | - | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
0 commit comments