This commit fixes an issue with the dependency management system where dependencies between subtasks of the same parent task were not being handled correctly. Previously, when trying to add a dependency between subtasks (e.g., making 23.8 depend on 23.13), the system incorrectly interpreted it as a circular dependency of the parent task depending on itself. Changes: - Modified add-dependency and remove-dependency commands to preserve string format for subtask IDs containing dots instead of converting them to integers - Updated dependency detection logic to properly handle string-based subtask IDs - Added specific tests verifying both successful dependency chains and circular dependency detection between subtasks of the same parent The fix ensures proper task ordering for development workflows where related subtasks must be completed in sequence (like establishing tests before implementing a feature). It maintains backward compatibility with existing task structures while correctly enforcing dependency chains within subtask groups. Tests: - Added tests for valid dependency chains between subtasks of the same parent - Added tests for circular dependency detection in subtask relationships - Added specific test for the 23.8->23.13->23.10 subtask dependency chain Resolves the issue where the suggested task development workflow couldn't be properly enforced through the dependency management system.
Task Master Test Suite
This directory contains tests for the Task Master CLI. The tests are organized into different categories to ensure comprehensive test coverage.
Test Structure
unit/: Unit tests for individual functions and componentsintegration/: Integration tests for testing interactions between componentse2e/: End-to-end tests for testing complete workflowsfixtures/: Test fixtures and sample data
Running Tests
To run all tests:
npm test
To run tests in watch mode (for development):
npm run test:watch
To run tests with coverage reporting:
npm run test:coverage
Testing Approach
Unit Tests
Unit tests focus on testing individual functions and components in isolation. These tests should be fast and should mock external dependencies.
Integration Tests
Integration tests focus on testing interactions between components. These tests ensure that components work together correctly.
End-to-End Tests
End-to-end tests focus on testing complete workflows from a user's perspective. These tests ensure that the CLI works correctly as a whole.
Test Fixtures
Test fixtures provide sample data for tests. Fixtures should be small, focused, and representative of real-world data.
Mocking
For external dependencies like file system operations and API calls, we use mocking to isolate the code being tested.
- File system operations: Use
mock-fsto mock the file system - API calls: Use Jest's mocking capabilities to mock API responses
Test Coverage
We aim for at least 80% test coverage for all code paths. Coverage reports can be generated with:
npm run test:coverage