Adds a test for parse-prd.

This commit is contained in:
Eyal Toledano
2025-03-24 17:33:57 -04:00
parent 341fbdf40f
commit 784a52a7a3
3 changed files with 219 additions and 10 deletions

View File

@@ -0,0 +1,44 @@
/**
* Sample Claude API response for testing
*/
export const sampleClaudeResponse = {
tasks: [
{
id: 1,
title: "Setup Task Data Structure",
description: "Implement the core task data structure and file operations",
status: "pending",
dependencies: [],
priority: "high",
details: "Create the tasks.json file structure with support for task properties including ID, title, description, status, dependencies, priority, details, and test strategy. Implement file system operations for reading and writing task data.",
testStrategy: "Verify tasks.json is created with the correct structure and that task data can be read from and written to the file."
},
{
id: 2,
title: "Implement CLI Foundation",
description: "Create the command-line interface foundation with basic commands",
status: "pending",
dependencies: [1],
priority: "high",
details: "Set up Commander.js for handling CLI commands. Implement the basic command structure including help documentation. Create the foundational command parsing logic.",
testStrategy: "Test each command to ensure it properly parses arguments and options. Verify help documentation is displayed correctly."
},
{
id: 3,
title: "Develop Task Management Operations",
description: "Implement core operations for creating, reading, updating, and deleting tasks",
status: "pending",
dependencies: [1],
priority: "medium",
details: "Implement functions for listing tasks, adding new tasks, updating task status, and removing tasks. Include support for filtering tasks by status and other properties.",
testStrategy: "Create unit tests for each CRUD operation to verify they correctly modify the task data."
}
],
metadata: {
projectName: "Task Management CLI",
totalTasks: 3,
sourceFile: "tests/fixtures/sample-prd.txt",
generatedAt: "2023-12-15"
}
};

42
tests/fixtures/sample-prd.txt vendored Normal file
View File

@@ -0,0 +1,42 @@
# Sample PRD for Testing
<PRD>
# Technical Architecture
## System Components
1. **Task Management Core**
- Tasks.json file structure
- Task model with dependencies
- Task state management
2. **Command Line Interface**
- Command parsing and execution
- Display utilities
## Data Models
### Task Model
```json
{
"id": 1,
"title": "Task Title",
"description": "Brief task description",
"status": "pending|done|deferred",
"dependencies": [0],
"priority": "high|medium|low",
"details": "Implementation instructions",
"testStrategy": "Verification approach"
}
```
# Development Roadmap
## Phase 1: Core Task Management System
1. **Task Data Structure**
- Implement the tasks.json structure
- Create file system interactions
2. **Command Line Interface Foundation**
- Implement command parsing
- Create help documentation
</PRD>