Testing Workflow
VSeed follows a strict test-driven development workflow. All test commands must be run from the project root directory.
Test Categories
1. Unit Tests
- Goal: Test individual utility functions and Pipeline node logic.
- Location:
packages/vseed/tests/unit - Run:
2. Integration Tests
- Goal: Test the complete chart generation flow (VSeed Spec → VChart Spec).
- Mechanism: Data-driven. Automatically generates test cases by reading JSON files under
packages/vseed/tests/integrationsand compares snapshots. - Run:
Core Workflow
Step 1: Run Tests
Run relevant tests frequently during development to verify logic.
Step 2: Handle Snapshot Changes
If your code changes cause the output Spec to change (e.g., fixing a bug or adding a feature):
- Check the diff in the console output and confirm if the changes are expected.
- If expected, run the update command:
Step 3: Coverage Check
Before committing, it's recommended to check test coverage.
Notes
- Auto-generated: Integration test
.test.tsfiles are generated by thegscript — do not edit manually. - Adding test cases: To add integration tests, simply add a new JSON config file to the appropriate category directory under
packages/vseed/tests/integrations, then runpnpm run g.