groundswell 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/subtask-planning/prp-base-create.md +120 -0
- package/.claude/commands/subtask-planning/prp-base-execute.md +65 -0
- package/.claude/commands/task-breakdown.md +94 -0
- package/.claude/system_prompts/task-breakdown.md +1 -0
- package/CHANGELOG.md +188 -0
- package/PRD.md +543 -0
- package/README.md +99 -5
- package/examples/README.md +15 -1
- package/examples/examples/11-reparenting-workflows.ts +269 -0
- package/examples/index.ts +4 -0
- package/package-lock.json +2398 -0
- package/package.json +3 -1
- package/plan/001_d3bb02af4886/TEST_RESULTS.md +259 -0
- package/plan/001_d3bb02af4886/bug_fix_tasks.json +484 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S1/PRP.md +488 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S2/PRP.md +581 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S3/PRP.md +687 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S1/PRP.md +492 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/PRP.md +932 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/concurrent_error_testing_patterns.md +1109 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/vitest_concurrent_testing.md +802 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/workflow_engine_test_references.md +603 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S1/PRP.md +564 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S3/PRP.md +518 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S4/PRP.md +1252 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/PRP.md +364 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/CODEBASE_INVENTORY.md +114 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/DECORATOR_DOCUMENTATION_PATTERNS.md +205 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/PRD_LOCATION_ANALYSIS.md +199 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/ULTRATHINK_PRP_PLAN.md +134 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S1/PRP.md +495 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S1/research/console_error_inventory.md +435 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S2/PRP.md +506 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S3/PRP.md +612 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T2S2/PRP.md +558 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T2S2/research/external_research.md +788 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S2/PRP.md +460 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S3/PRP.md +454 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/PRP.md +520 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/RECOMMENDATION.md +417 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/research/external_workflow_engines_research.md +760 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/research/security_implications_analysis.md +245 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S2/PRP.md +792 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S1/PRP.md +535 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S1/TEST_EXECUTION_REPORT.md +190 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/PRP.md +654 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/TEST_FIX_REPORT.md +227 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/KEY_FINDINGS.md +345 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/QUICK_REFERENCE.md +193 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/test_maintenance_research.md +1323 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S1/BREAKING_CHANGES_AUDIT.md +1011 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S1/PRP.md +927 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S2/PRP.md +505 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/architecture/logger_child_signature_analysis.md +401 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/child_implementation_research.md +142 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/test_patterns_research.md +112 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/vitest_patterns_research.md +159 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/PRP.md +549 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/VERIFICATION_REPORT.md +368 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/edge_case_analysis.md +172 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/usage_inventory.md +175 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T1S2/PRP.md +696 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T1S4/PRP.md +860 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/PRP.md +1066 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/01-testing-aggregated-errors.md +1103 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/01_typescript_error_aggregation_patterns.md +789 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/02-error-merge-strategy-testing-guide.md +1098 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/02_aggregate_error_patterns.md +1037 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/03-promise-allsettled-testing-patterns.md +916 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/03_error_merging_strategies.md +1045 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/04_github_stackoverflow_examples.md +890 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/05_comprehensive_summary.md +822 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/INDEX.md +668 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/QUICK_REFERENCE.md +706 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/README.md +265 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/RESEARCH_REPORT.md +655 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S4/research/vitest_testing_patterns.md +1103 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T3S2/PRP.md +426 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/PRP.md +506 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/QUICK_REFERENCE.md +114 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/RESEARCH_SUMMARY.md +316 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/vitest_observer_error_logging_best_practices.md +754 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S3/PRP.md +612 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/PRP.md +719 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/README.md +215 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/analysis.md +765 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S3/PRP.md +718 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/DECISION.md +149 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/PRP.md +470 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/ULTRATHINK_PLAN.md +332 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/codebase_workflow_name_analysis.md +167 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/external_best_practices.md +265 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/validation_patterns.md +273 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T4S1/workflow_engine_ancestry_api_research.md +760 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T4S3-PRP.md +434 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S1/PRP.md +717 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/PRP.md +472 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/VALIDATION_REPORT.md +125 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/research/ULTRATHINK_PRP_PLAN.md +301 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/error-logging-best-practices.md +1170 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/research_typescript_partial_and_overloads.md +940 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/vitest-quick-reference.md +151 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/vitest-research.md +650 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/prd_snapshot.md +259 -0
- package/plan/001_d3bb02af4886/bugfix/P1M1T1S1/PRP.md +457 -0
- package/plan/001_d3bb02af4886/bugfix/RESEARCH_SUMMARY.md +346 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/codebase_structure.md +311 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/concurrent_execution_best_practices.md +1565 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/error_handling_patterns.md +288 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/promise_all_analysis.md +741 -0
- package/plan/001_d3bb02af4886/docs/PRP/P1M1T1S4-functional-workflow-error-state-capture-test.md +652 -0
- package/plan/001_d3bb02af4886/docs/PRP/PRP.md +527 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S1-PRP.md +415 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S2-PRP.md +378 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S4-PRP.md +713 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M2T1S4-PRP.md +370 -0
- package/plan/001_d3bb02af4886/docs/PRP_P1M3T1S3.md +499 -0
- package/plan/001_d3bb02af4886/docs/TEST_RESULTS.md +230 -0
- package/plan/001_d3bb02af4886/docs/bugfix/ANALYSIS_PRD_VS_IMPLEMENTATION.md +1134 -0
- package/plan/001_d3bb02af4886/docs/bugfix/GAP_ANALYSIS_SUMMARY.md +179 -0
- package/plan/001_d3bb02af4886/docs/bugfix/P1M4T2S1/PRP.md +629 -0
- package/plan/001_d3bb02af4886/docs/bugfix/P1M4T2S1/validation-report.md +214 -0
- package/plan/001_d3bb02af4886/docs/bugfix/PRP_P1M4T2S3.md +629 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_PRP.md +529 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_QUICK_REFERENCE.md +142 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_README.md +304 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_TEST_RESULTS.md +558 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_VALIDATION_SUMMARY.md +256 -0
- package/plan/001_d3bb02af4886/docs/bugfix/system_context.md +346 -0
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/bug_analysis.md +415 -0
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/implementation_patterns.md +489 -0
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/system_context.md +218 -0
- package/plan/001_d3bb02af4886/docs/bugfix_INITIATION_SUMMARY.md +380 -0
- package/plan/001_d3bb02af4886/docs/research/CYCLE_DETECTION_PATTERNS.md +1923 -0
- package/plan/001_d3bb02af4886/docs/research/CYCLE_DETECTION_QUICK_REF.md +319 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/codebase-context.md +115 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/cycle-detection-algorithms.md +134 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/test-patterns.md +153 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/workflow-class.md +132 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/DECORATOR_DOCUMENTATION_BEST_PRACTICES.md +716 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/DECORATOR_DOCUMENTATION_QUICK_REF.md +186 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/GROUNDSWELL_DECORATOR_EXAMPLES.md +604 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/INDEX.md +213 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/codebase_structure.md +30 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/existing_test_pattern.md +56 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/getRootObservers_implementation.md +53 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/test_conventions.md +49 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/PRP.md +958 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/QUICK_REFERENCE.md +339 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/README.md +305 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/SUMMARY.md +433 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/bidirectional-tree-consistency-testing.md +1574 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/test-pattern-examples.md +1014 -0
- package/plan/001_d3bb02af4886/docs/research/PROMISE_ALLSETTLED_QUICK_REF.md +376 -0
- package/plan/001_d3bb02af4886/docs/research/PROMISE_ALLSETTLED_RESEARCH.md +1507 -0
- package/plan/001_d3bb02af4886/docs/research/bugfix_typescript_patterns.md +949 -0
- package/plan/001_d3bb02af4886/docs/research/error-testing-research.md +619 -0
- package/plan/001_d3bb02af4886/docs/research/error_handling_patterns.md +723 -0
- package/plan/{research → 001_d3bb02af4886/docs/research/general}/introspection-security-guide.md +56 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/PRP_TEMPLATE.md +460 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/QUICK_REFERENCE.md +324 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/README.md +175 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/RESEARCH_REPORT.md +499 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/SUMMARY.md +163 -0
- package/plan/bugfix/BUG_FIX_SUMMARY.md +961 -0
- package/src/__tests__/adversarial/attachChild-performance.test.ts +216 -0
- package/src/__tests__/adversarial/circular-reference.test.ts +101 -0
- package/src/__tests__/adversarial/complex-circular-reference.test.ts +139 -0
- package/src/__tests__/adversarial/concurrent-task-failures.test.ts +571 -0
- package/src/__tests__/adversarial/deep-analysis.test.ts +729 -0
- package/src/__tests__/adversarial/deep-hierarchy-stress.test.ts +213 -0
- package/src/__tests__/adversarial/e2e-prd-validation.test.ts +448 -0
- package/src/__tests__/adversarial/edge-case.test.ts +703 -0
- package/src/__tests__/adversarial/error-merge-strategy.test.ts +760 -0
- package/src/__tests__/adversarial/incremental-performance.test.ts +140 -0
- package/src/__tests__/adversarial/node-map-update-benchmarks.test.ts +457 -0
- package/src/__tests__/adversarial/observer-propagation.test.ts +487 -0
- package/src/__tests__/adversarial/parent-validation.test.ts +143 -0
- package/src/__tests__/adversarial/prd-12-2-compliance.test.ts +611 -0
- package/src/__tests__/adversarial/prd-compliance.test.ts +731 -0
- package/src/__tests__/compatibility/backward-compatibility.test.ts +1572 -0
- package/src/__tests__/helpers/index.ts +18 -0
- package/src/__tests__/helpers/tree-verification.ts +257 -0
- package/src/__tests__/integration/bidirectional-consistency.test.ts +847 -0
- package/src/__tests__/integration/observer-logging.test.ts +643 -0
- package/src/__tests__/integration/tree-mirroring.test.ts +37 -0
- package/src/__tests__/integration/workflow-reparenting.test.ts +303 -0
- package/src/__tests__/unit/context.test.ts +79 -0
- package/src/__tests__/unit/logger.test.ts +293 -0
- package/src/__tests__/unit/observable.test.ts +321 -0
- package/src/__tests__/unit/tree-debugger-incremental.test.ts +170 -0
- package/src/__tests__/unit/utils/workflow-error-utils.test.ts +209 -0
- package/src/__tests__/unit/workflow-detachChild.test.ts +100 -0
- package/src/__tests__/unit/workflow-emitEvent-childDetached.test.ts +153 -0
- package/src/__tests__/unit/workflow-isDescendantOf.test.ts +180 -0
- package/src/__tests__/unit/workflow.test.ts +277 -1
- package/src/core/agent.ts +21 -1
- package/src/core/logger.ts +27 -2
- package/src/core/workflow-context.ts +6 -4
- package/src/core/workflow.ts +252 -14
- package/src/debugger/tree-debugger.ts +52 -7
- package/src/decorators/task.ts +65 -2
- package/src/index.ts +4 -2
- package/src/types/decorators.ts +8 -1
- package/src/types/events.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/observable.ts +32 -3
- package/src/utils/workflow-error-utils.ts +56 -0
- package/tsconfig.json +1 -1
- package/llms_full.txt +0 -5890
- package/tasks.json +0 -0
- /package/plan/{backlog.json → 001_d3bb02af4886/backlog.json} +0 -0
- /package/plan/{P1P2/PRP.md → 001_d3bb02af4886/docs/PRP/P1P2-PRP.md} +0 -0
- /package/plan/{P3P4/PRP.md → 001_d3bb02af4886/docs/PRP/P3P4-PRP.md} +0 -0
- /package/plan/{P4P5/PRP.md → 001_d3bb02af4886/docs/PRP/P4P5-PRP.md} +0 -0
- /package/plan/{architecture → 001_d3bb02af4886/docs/architecture}/external_deps.md +0 -0
- /package/plan/{architecture → 001_d3bb02af4886/docs/architecture}/system_context.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_BEST_PRACTICES.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_CODE_PATTERNS.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_INTEGRATION_GUIDE.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_RESEARCH_INDEX.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/REFLECTION_INDEX.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/REFLECTION_RESEARCH_REPORT.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/RESEARCH_SUMMARY.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/anthropic-sdk.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/async-local-storage.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-code-patterns.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-decision-matrix.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-implementation-guide.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-integration-guide.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-patterns.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-quick-reference.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/zod-schema.md +0 -0
- /package/plan/{P3P4/research → 001_d3bb02af4886/docs/research/P3P4}/caching-lru.md +0 -0
- /package/plan/{P3P4/research → 001_d3bb02af4886/docs/research/P3P4}/introspection-tools.md +0 -0
- /package/plan/{P3P4/research → 001_d3bb02af4886/docs/research/P3P4}/reflection-patterns.md +0 -0
- /package/plan/{P4P5/research → 001_d3bb02af4886/docs/research/P4P5}/RESEARCH_SUMMARY.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/INTROSPECTION_RESEARCH_SUMMARY.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/README-INTROSPECTION.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/agent-introspection-patterns.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/introspection-tool-examples.md +0 -0
- /package/{PRPs/PRDs/001-hierarchical-workflow-engine.md → plan/001_d3bb02af4886/prd_snapshot.md} +0 -0
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
# Vitest Documentation Research
|
|
2
|
+
|
|
3
|
+
> **Research Date:** 2026-01-12
|
|
4
|
+
> **Vitest Version:** ^1.0.0 (installed in project)
|
|
5
|
+
> **Project:** /home/dustin/projects/groundswell
|
|
6
|
+
|
|
7
|
+
## Executive Summary
|
|
8
|
+
|
|
9
|
+
This document consolidates Vitest documentation findings for running test suites, capturing output, filtering tests, generating reports, and best practices. The web search and web documentation tools were unavailable at research time, so this compiles official Vitest documentation knowledge based on the installed version and general Vitest best practices.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. Running Full Test Suite and Capturing Detailed Output
|
|
14
|
+
|
|
15
|
+
### Basic Commands
|
|
16
|
+
|
|
17
|
+
| Command | Description |
|
|
18
|
+
|---------|-------------|
|
|
19
|
+
| `vitest` | Runs tests in watch mode (default) |
|
|
20
|
+
| `vitest run` | Runs tests once without watch mode (CI mode) |
|
|
21
|
+
| `npm test` | Runs the configured test script (`vitest run`) |
|
|
22
|
+
|
|
23
|
+
### Current Project Configuration
|
|
24
|
+
|
|
25
|
+
**File:** `/home/dustin/projects/groundswell/vitest.config.ts`
|
|
26
|
+
```typescript
|
|
27
|
+
import { defineConfig } from 'vitest/config';
|
|
28
|
+
|
|
29
|
+
export default defineConfig({
|
|
30
|
+
test: {
|
|
31
|
+
include: ['src/__tests__/**/*.test.ts'],
|
|
32
|
+
globals: true,
|
|
33
|
+
},
|
|
34
|
+
resolve: {
|
|
35
|
+
alias: {},
|
|
36
|
+
},
|
|
37
|
+
esbuild: {
|
|
38
|
+
target: 'node18',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**File:** `/home/dustin/projects/groundswell/package.json` (test scripts)
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"scripts": {
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Verbose Output
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Run with verbose output showing all test details
|
|
57
|
+
vitest run --reporter=verbose
|
|
58
|
+
|
|
59
|
+
# Run with default reporter (shows dots/progress)
|
|
60
|
+
vitest run
|
|
61
|
+
|
|
62
|
+
# Silent mode - minimal output
|
|
63
|
+
vitest run --silent
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 2. Getting Test Counts (Total, Pass, Fail)
|
|
69
|
+
|
|
70
|
+
### Console Output
|
|
71
|
+
|
|
72
|
+
Vitest automatically displays test counts in the console output:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
✓ src/__tests__/example.test.ts (2)
|
|
76
|
+
✓ should pass
|
|
77
|
+
✓ should also pass
|
|
78
|
+
|
|
79
|
+
Test Files 1 passed (1)
|
|
80
|
+
Tests 2 passed (2)
|
|
81
|
+
Start at 14:23:15
|
|
82
|
+
Duration 1.23s
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### JSON Reporter for Programmatic Count Extraction
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Generate JSON report with counts
|
|
89
|
+
vitest run --reporter=json --outputFile=test-results.json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The JSON output structure includes:
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"testResults": [
|
|
96
|
+
{
|
|
97
|
+
"name": "Example test suite",
|
|
98
|
+
"status": "passed",
|
|
99
|
+
"assertionResults": [...]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"success": true,
|
|
103
|
+
"stats": {
|
|
104
|
+
"tests": 10,
|
|
105
|
+
"failures": 0,
|
|
106
|
+
"errors": 0
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Exit Codes
|
|
112
|
+
|
|
113
|
+
Vitest returns standard exit codes:
|
|
114
|
+
- **0**: All tests passed
|
|
115
|
+
- **1**: Tests failed
|
|
116
|
+
|
|
117
|
+
### Capturing Counts in Shell Scripts
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
#!/bin/bash
|
|
121
|
+
# Capture test results
|
|
122
|
+
npm test 2>&1 | tee test-output.log
|
|
123
|
+
|
|
124
|
+
# Parse for counts
|
|
125
|
+
grep -E "(Test Files|Tests)" test-output.log
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 3. Filtering and Testing Specific Patterns
|
|
131
|
+
|
|
132
|
+
### Filter by Test File Pattern
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Run tests in a specific file
|
|
136
|
+
vitest run src/__tests__/specific.test.ts
|
|
137
|
+
|
|
138
|
+
# Run tests matching a glob pattern
|
|
139
|
+
vitest run src/__tests__/**/*workflow*.test.ts
|
|
140
|
+
|
|
141
|
+
# Run tests in a directory
|
|
142
|
+
vitest run src/__tests__/integration/
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Filter by Test Name Pattern
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Run tests matching name pattern (shorthand)
|
|
149
|
+
vitest run -t "authentication"
|
|
150
|
+
|
|
151
|
+
# Run tests matching name pattern (long form)
|
|
152
|
+
vitest run --testNamePattern="authentication"
|
|
153
|
+
|
|
154
|
+
# Run tests with regex pattern
|
|
155
|
+
vitest run --testNamePattern="should.*pass"
|
|
156
|
+
|
|
157
|
+
# Multiple patterns (regex OR)
|
|
158
|
+
vitest run --testNamePattern="auth|login|signin"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Filter by Test Suite (describe)
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Run only tests in a specific describe block
|
|
165
|
+
vitest run -t "User authentication"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### In-Code Filtering
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
import { test, describe } from 'vitest';
|
|
172
|
+
|
|
173
|
+
// Skip this test
|
|
174
|
+
test.skip('skipped test', () => {
|
|
175
|
+
// This won't run
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// Run only this test
|
|
179
|
+
test.only('exclusive test', () => {
|
|
180
|
+
// Only this runs
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// Skip entire suite
|
|
184
|
+
describe.skip('skipped suite', () => {
|
|
185
|
+
test('example', () => {});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Run only this suite
|
|
189
|
+
describe.only('exclusive suite', () => {
|
|
190
|
+
test('example', () => {});
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Watch Mode Filtering
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Watch mode with pattern filter
|
|
198
|
+
vitest -t "pattern"
|
|
199
|
+
|
|
200
|
+
# Watch mode for specific file
|
|
201
|
+
vitest specific.test.ts
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 4. Generating Test Reports
|
|
207
|
+
|
|
208
|
+
### Built-in Reporters
|
|
209
|
+
|
|
210
|
+
Vitest supports multiple reporter types:
|
|
211
|
+
|
|
212
|
+
| Reporter | Description | Output Format |
|
|
213
|
+
|----------|-------------|---------------|
|
|
214
|
+
| `default` | Basic console output with progress | Terminal |
|
|
215
|
+
| `verbose` | Detailed test output | Terminal |
|
|
216
|
+
| `dot` | Minimal output with dots | Terminal |
|
|
217
|
+
| `json` | JSON format test results | File |
|
|
218
|
+
| `junit` | JUnit XML format | File |
|
|
219
|
+
| `tap` | TAP (Test Anything Protocol) | Terminal/File |
|
|
220
|
+
| `html` | HTML test report | File |
|
|
221
|
+
|
|
222
|
+
### Single Reporter Configuration
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# JSON report
|
|
226
|
+
vitest run --reporter=json --outputFile=test-results.json
|
|
227
|
+
|
|
228
|
+
# JUnit report (for CI/CD)
|
|
229
|
+
vitest run --reporter=junit --outputFile=test-results.xml
|
|
230
|
+
|
|
231
|
+
# HTML report
|
|
232
|
+
vitest run --reporter=html --outputFile=test-report.html
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Multiple Reporters (Recommended)
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Console + JSON + JUnit
|
|
239
|
+
vitest run \
|
|
240
|
+
--reporter=verbose \
|
|
241
|
+
--reporter=json \
|
|
242
|
+
--reporter=junit \
|
|
243
|
+
--outputFile.json=test-results.json \
|
|
244
|
+
--outputFile.junit=test-results.xml
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Configuration File Setup
|
|
248
|
+
|
|
249
|
+
Update `/home/dustin/projects/groundswell/vitest.config.ts`:
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { defineConfig } from 'vitest/config';
|
|
253
|
+
|
|
254
|
+
export default defineConfig({
|
|
255
|
+
test: {
|
|
256
|
+
include: ['src/__tests__/**/*.test.ts'],
|
|
257
|
+
globals: true,
|
|
258
|
+
// Add reporters configuration
|
|
259
|
+
reporters: [
|
|
260
|
+
'verbose', // Console output
|
|
261
|
+
['json', { outputFile: './test-results.json' }],
|
|
262
|
+
['junit', { outputFile: './test-results.xml' }],
|
|
263
|
+
['html', { outputFile: './test-report/index.html' }]
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
resolve: {
|
|
267
|
+
alias: {},
|
|
268
|
+
},
|
|
269
|
+
esbuild: {
|
|
270
|
+
target: 'node18',
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Coverage Reports
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Generate coverage with V8 provider (default)
|
|
279
|
+
vitest run --coverage
|
|
280
|
+
|
|
281
|
+
# Coverage with HTML report
|
|
282
|
+
vitest run --coverage --coverage.reporter=html
|
|
283
|
+
|
|
284
|
+
# Multiple coverage reporters
|
|
285
|
+
vitest run \
|
|
286
|
+
--coverage \
|
|
287
|
+
--coverage.reporter=text \
|
|
288
|
+
--coverage.reporter=json \
|
|
289
|
+
--coverage.reporter=html \
|
|
290
|
+
--coverage.reportsDirectory=./coverage
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Coverage configuration in vitest.config.ts:
|
|
294
|
+
```typescript
|
|
295
|
+
export default defineConfig({
|
|
296
|
+
test: {
|
|
297
|
+
coverage: {
|
|
298
|
+
provider: 'v8', // or 'istanbul'
|
|
299
|
+
reporter: ['text', 'json', 'html', 'lcov'],
|
|
300
|
+
reportsDirectory: './coverage',
|
|
301
|
+
exclude: ['**/node_modules/**', '**/dist/**', '**/*.test.ts'],
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 5. Common CLI Options and Flags for Test Reporting
|
|
310
|
+
|
|
311
|
+
### Essential CLI Flags
|
|
312
|
+
|
|
313
|
+
| Flag | Alias | Description |
|
|
314
|
+
|------|-------|-------------|
|
|
315
|
+
| `--run` | -r | Run tests once (disable watch mode) |
|
|
316
|
+
| `--watch` | -w | Enable watch mode (default) |
|
|
317
|
+
| `--reporter=<type>` | -r | Specify reporter type |
|
|
318
|
+
| `--outputFile=<path>` | | Output file for reporter |
|
|
319
|
+
| `--config=<path>` | -c | Use custom config file |
|
|
320
|
+
| `--root=<path>` | | Specify project root |
|
|
321
|
+
| `--silent` | -s | Reduce output verbosity |
|
|
322
|
+
| `--no-coverage` | | Disable coverage collection |
|
|
323
|
+
| `--threads` | | Run tests in threads (default) |
|
|
324
|
+
| `--no-threads` | | Run tests in same thread |
|
|
325
|
+
| `--inspect` | | Enable Node.js inspector |
|
|
326
|
+
| `--testNamePattern=<regex>` | -t | Run tests matching pattern |
|
|
327
|
+
| `--ui` | | Launch Vitest UI interface |
|
|
328
|
+
| `--api` | | Start API server for UI |
|
|
329
|
+
| `--coverage` | | Enable coverage collection |
|
|
330
|
+
|
|
331
|
+
### Help and Version
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
# Show help with all options
|
|
335
|
+
vitest --help
|
|
336
|
+
|
|
337
|
+
# Show Vitest version
|
|
338
|
+
vitest --version
|
|
339
|
+
|
|
340
|
+
# Show all CLI options
|
|
341
|
+
vitest run --help
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Environment Variables
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
# Set environment
|
|
348
|
+
CI=true vitest run
|
|
349
|
+
|
|
350
|
+
# Set Node options
|
|
351
|
+
NODE_OPTIONS="--max-old-space-size=4096" vitest run
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## 6. Best Practices for Test Result Documentation
|
|
357
|
+
|
|
358
|
+
### 1. Descriptive Test Names
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
// Good: Clear, descriptive names
|
|
362
|
+
describe('User authentication', () => {
|
|
363
|
+
it('should return success when valid credentials are provided', () => {
|
|
364
|
+
// Test implementation
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it('should return 401 when credentials are invalid', () => {
|
|
368
|
+
// Test implementation
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
// Avoid: Vague names
|
|
373
|
+
describe('Auth', () => {
|
|
374
|
+
it('works', () => {
|
|
375
|
+
// Unclear what this tests
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### 2. Organize Tests Logically
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
describe('Workflow orchestration', () => {
|
|
384
|
+
describe('Task execution', () => {
|
|
385
|
+
describe('Parallel tasks', () => {
|
|
386
|
+
it('should execute tasks concurrently when specified', () => {});
|
|
387
|
+
});
|
|
388
|
+
describe('Sequential tasks', () => {
|
|
389
|
+
it('should execute tasks in order when dependencies exist', () => {});
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
});
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### 3. Use Custom Reporters for Documentation
|
|
396
|
+
|
|
397
|
+
```typescript
|
|
398
|
+
// Custom reporter that generates documentation
|
|
399
|
+
const documentationReporter = {
|
|
400
|
+
onFinished(files) {
|
|
401
|
+
const doc = generateTestDocumentation(files);
|
|
402
|
+
fs.writeFileSync('./TEST_DOCUMENTATION.md', doc);
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### 4. Generate Test Documentation
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
# Add to package.json scripts
|
|
411
|
+
{
|
|
412
|
+
"scripts": {
|
|
413
|
+
"test:report": "vitest run --reporter=verbose --reporter=json --outputFile=test-results.json",
|
|
414
|
+
"test:ci": "vitest run --reporter=junit --outputFile=test-results.xml",
|
|
415
|
+
"test:coverage": "vitest run --coverage --coverage.reporter=html"
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### 5. Document Test Outcomes
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
import { test, describe } from 'vitest';
|
|
424
|
+
|
|
425
|
+
describe('Feature X', () => {
|
|
426
|
+
// Document expected behavior
|
|
427
|
+
it('validates input according to RFC 1234 section 5.2', () => {
|
|
428
|
+
// Test validates compliance
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// Document edge cases
|
|
432
|
+
it('handles null input gracefully without throwing', () => {
|
|
433
|
+
// Test for edge case
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// Document integration points
|
|
437
|
+
it('integrates with external API according to contract', () => {
|
|
438
|
+
// Test for API contract
|
|
439
|
+
});
|
|
440
|
+
});
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### 6. Use Test Annotations
|
|
444
|
+
|
|
445
|
+
```typescript
|
|
446
|
+
// Document test purpose with comments
|
|
447
|
+
describe('Payment processing', () => {
|
|
448
|
+
/**
|
|
449
|
+
* Critical: Tests Stripe integration for refunds
|
|
450
|
+
* @see https://stripe.com/docs/api/refunds
|
|
451
|
+
*/
|
|
452
|
+
it('processes refund successfully', () => {
|
|
453
|
+
// Critical payment flow test
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### 7. Maintain Test Evidence
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
# Save test output with timestamp
|
|
462
|
+
vitest run --reporter=verbose | tee "test-output-$(date +%Y%m%d-%H%M%S).log"
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### 8. CI/CD Integration Best Practices
|
|
466
|
+
|
|
467
|
+
```yaml
|
|
468
|
+
# Example GitHub Actions workflow
|
|
469
|
+
- name: Run tests
|
|
470
|
+
run: npm test
|
|
471
|
+
|
|
472
|
+
- name: Generate test report
|
|
473
|
+
if: always()
|
|
474
|
+
run: vitest run --reporter=junit --outputFile=test-results.xml
|
|
475
|
+
|
|
476
|
+
- name: Upload test results
|
|
477
|
+
if: always()
|
|
478
|
+
uses: actions/upload-artifact@v3
|
|
479
|
+
with:
|
|
480
|
+
name: test-results
|
|
481
|
+
path: test-results.xml
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### 9. Test Result Summary
|
|
485
|
+
|
|
486
|
+
Create a test summary document after each run:
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
# Add this as a post-test script
|
|
490
|
+
cat > TEST_SUMMARY.md << EOF
|
|
491
|
+
# Test Execution Summary
|
|
492
|
+
|
|
493
|
+
**Date:** $(date)
|
|
494
|
+
**Branch:** $(git branch --show-current)
|
|
495
|
+
**Commit:** $(git rev-parse HEAD)
|
|
496
|
+
|
|
497
|
+
## Results
|
|
498
|
+
$(npm test | grep -E "(Test Files|Tests|Duration)")
|
|
499
|
+
|
|
500
|
+
## Coverage
|
|
501
|
+
$(npm run test:coverage 2>&1 | grep -E "(Statements|Branches|Functions|Lines)")
|
|
502
|
+
EOF
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
### 10. Version Control for Test Artifacts
|
|
506
|
+
|
|
507
|
+
```bash
|
|
508
|
+
# Add to .gitignore
|
|
509
|
+
test-results.json
|
|
510
|
+
test-results.xml
|
|
511
|
+
coverage/
|
|
512
|
+
test-report/
|
|
513
|
+
|
|
514
|
+
# But commit test documentation
|
|
515
|
+
TEST_DOCUMENTATION.md
|
|
516
|
+
TEST_SUMMARY.md
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
## Recommended Project-Specific Configuration
|
|
522
|
+
|
|
523
|
+
Based on the current Groundswell project setup, here are recommended additions to `/home/dustin/projects/groundswell/vitest.config.ts`:
|
|
524
|
+
|
|
525
|
+
```typescript
|
|
526
|
+
import { defineConfig } from 'vitest/config';
|
|
527
|
+
|
|
528
|
+
export default defineConfig({
|
|
529
|
+
test: {
|
|
530
|
+
include: ['src/__tests__/**/*.test.ts'],
|
|
531
|
+
globals: true,
|
|
532
|
+
// Test reporters for comprehensive output
|
|
533
|
+
reporters: [
|
|
534
|
+
'verbose', // Console output
|
|
535
|
+
['json', { outputFile: './test-results.json' }],
|
|
536
|
+
['html', { outputFile: './test-report/index.html' }]
|
|
537
|
+
],
|
|
538
|
+
// Coverage configuration
|
|
539
|
+
coverage: {
|
|
540
|
+
provider: 'v8',
|
|
541
|
+
reporter: ['text', 'json', 'html', 'lcov'],
|
|
542
|
+
reportsDirectory: './coverage',
|
|
543
|
+
exclude: [
|
|
544
|
+
'**/node_modules/**',
|
|
545
|
+
'**/dist/**',
|
|
546
|
+
'**/*.test.ts',
|
|
547
|
+
'**/examples/**'
|
|
548
|
+
],
|
|
549
|
+
thresholds: {
|
|
550
|
+
statements: 80,
|
|
551
|
+
branches: 80,
|
|
552
|
+
functions: 80,
|
|
553
|
+
lines: 80
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
// Test timeout
|
|
557
|
+
testTimeout: 10000,
|
|
558
|
+
// Hook timeout
|
|
559
|
+
hookTimeout: 10000,
|
|
560
|
+
},
|
|
561
|
+
resolve: {
|
|
562
|
+
alias: {},
|
|
563
|
+
},
|
|
564
|
+
esbuild: {
|
|
565
|
+
target: 'node18',
|
|
566
|
+
},
|
|
567
|
+
});
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### Recommended NPM Scripts
|
|
571
|
+
|
|
572
|
+
```json
|
|
573
|
+
{
|
|
574
|
+
"scripts": {
|
|
575
|
+
"test": "vitest run",
|
|
576
|
+
"test:watch": "vitest",
|
|
577
|
+
"test:ui": "vitest --ui",
|
|
578
|
+
"test:report": "vitest run --reporter=verbose --reporter=json --outputFile=test-results.json",
|
|
579
|
+
"test:ci": "vitest run --reporter=junit --outputFile=test-results.xml",
|
|
580
|
+
"test:coverage": "vitest run --coverage --coverage.reporter=html",
|
|
581
|
+
"test:file": "vitest run",
|
|
582
|
+
"test:pattern": "vitest run"
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Official Documentation URLs
|
|
590
|
+
|
|
591
|
+
While the web search and documentation fetch tools were unavailable during this research, the following are the official Vitest documentation URLs for reference:
|
|
592
|
+
|
|
593
|
+
- **CLI Reference:** https://vitest.dev/guide/cli.html
|
|
594
|
+
- **Reporters:** https://vitest.dev/guide/reporters.html
|
|
595
|
+
- **Coverage:** https://vitest.dev/guide/coverage.html
|
|
596
|
+
- **Configuration:** https://vitest.dev/config/
|
|
597
|
+
- **API Reference:** https://vitest.dev/api/
|
|
598
|
+
- **Guide Index:** https://vitest.dev/guide/
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
## Quick Reference Command Sheet
|
|
603
|
+
|
|
604
|
+
```bash
|
|
605
|
+
# === Running Tests ===
|
|
606
|
+
vitest # Watch mode
|
|
607
|
+
vitest run # CI mode
|
|
608
|
+
npm test # Project test script
|
|
609
|
+
|
|
610
|
+
# === Filtering ===
|
|
611
|
+
vitest run path/to/test.ts # Specific file
|
|
612
|
+
vitest run -t "pattern" # Test name pattern
|
|
613
|
+
vitest run src/__tests__/ # Directory
|
|
614
|
+
|
|
615
|
+
# === Output & Reports ===
|
|
616
|
+
vitest run --reporter=verbose # Verbose console
|
|
617
|
+
vitest run --reporter=json --outputFile=out.json # JSON report
|
|
618
|
+
vitest run --reporter=junit --outputFile=out.xml # JUnit report
|
|
619
|
+
vitest run --reporter=html --outputFile=out.html # HTML report
|
|
620
|
+
|
|
621
|
+
# === Coverage ===
|
|
622
|
+
vitest run --coverage # Generate coverage
|
|
623
|
+
vitest run --coverage --coverage.reporter=html # HTML coverage
|
|
624
|
+
|
|
625
|
+
# === UI ===
|
|
626
|
+
vitest --ui # Launch UI
|
|
627
|
+
vitest --api # Start API server
|
|
628
|
+
|
|
629
|
+
# === Help ===
|
|
630
|
+
vitest --help # Show help
|
|
631
|
+
vitest --version # Show version
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
---
|
|
635
|
+
|
|
636
|
+
## Summary for Groundswell Project
|
|
637
|
+
|
|
638
|
+
Given the current setup in `/home/dustin/projects/groundswell`:
|
|
639
|
+
|
|
640
|
+
1. **Current Test Script:** `npm test` runs `vitest run` (CI mode)
|
|
641
|
+
2. **Test Location:** `src/__tests__/**/*.test.ts`
|
|
642
|
+
3. **Recommended Additions:**
|
|
643
|
+
- Add JSON/HTML reporters for better test documentation
|
|
644
|
+
- Add coverage reporting with thresholds
|
|
645
|
+
- Add test filtering scripts
|
|
646
|
+
- Consider adding Vitest UI for development workflow
|
|
647
|
+
|
|
648
|
+
---
|
|
649
|
+
|
|
650
|
+
*Document compiled on 2026-01-12 for the Groundswell project.*
|