You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Developers often need to validate outputs such as strings, JSON, or structured data against a previously approved version to ensure that changes in the code don’t unintentionally alter expected outputs. Without snapshot testing, manually verifying such outputs is time-consuming and error-prone.
Describe the solution you’d like
Integrate snapshot testing functionality into Fossil Test to automatically capture, store, and compare test outputs.
Features:
1. Snapshot Storage
• Store snapshots as files in a dedicated directory (e.g., snapshots/).
• Use test names to name snapshot files (e.g., test_function_output.snap).
• Allow storage in a custom directory via configuration.
2. Snapshot Matching
• Automatically compare current outputs with stored snapshots during test runs.
• Mark tests as failed if snapshots don’t match.
• Show a detailed diff highlighting mismatched lines.
3. Snapshot Management Commands
• --snapshot-update: Approve and overwrite snapshots with the new output.
• --snapshot-clean: Remove unused or outdated snapshots.
• CLI prompt to approve updates interactively when differences are detected (optional).
4. Data Format
• Support structured (e.g., JSON, XML) and unstructured data (e.g., strings, text files).
• Allow custom serializers and deserializers for non-text formats.
5. Integration
• Seamlessly integrate into existing Fossil Test workflows.
• Ensure compatibility with Fossil Mock for testing outputs from mocked components.
6. Reporting
• Show snapshot test results in the final test summary.
• Include snapshots in unified reporting for Fossil Test and Fossil Mock.
Describe alternatives you’ve considered
1. Manual Validation:
Developers manually check outputs by saving files and diffing them with tools like diff or git. This is tedious and not automated.
2. Custom Assertions:
Using custom assertions to check outputs against stored files. This provides partial automation but lacks integration with test frameworks.
Additional Context
• Use Cases:
• Validating API responses against known outputs.
• Checking console logs or error messages for consistency.
• Testing UI rendering outputs (e.g., HTML or JSON structures).
• Implementation Notes:
• Consider storing snapshot metadata (e.g., test environment details) alongside the snapshot.
• Offer options to ignore whitespace or specific fields when comparing snapshots.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Developers often need to validate outputs such as strings, JSON, or structured data against a previously approved version to ensure that changes in the code don’t unintentionally alter expected outputs. Without snapshot testing, manually verifying such outputs is time-consuming and error-prone.
Describe the solution you’d like
Integrate snapshot testing functionality into Fossil Test to automatically capture, store, and compare test outputs.
Features:
1. Snapshot Storage
• Store snapshots as files in a dedicated directory (e.g., snapshots/).
• Use test names to name snapshot files (e.g., test_function_output.snap).
• Allow storage in a custom directory via configuration.
2. Snapshot Matching
• Automatically compare current outputs with stored snapshots during test runs.
• Mark tests as failed if snapshots don’t match.
• Show a detailed diff highlighting mismatched lines.
3. Snapshot Management Commands
• --snapshot-update: Approve and overwrite snapshots with the new output.
• --snapshot-clean: Remove unused or outdated snapshots.
• CLI prompt to approve updates interactively when differences are detected (optional).
4. Data Format
• Support structured (e.g., JSON, XML) and unstructured data (e.g., strings, text files).
• Allow custom serializers and deserializers for non-text formats.
5. Integration
• Seamlessly integrate into existing Fossil Test workflows.
• Ensure compatibility with Fossil Mock for testing outputs from mocked components.
6. Reporting
• Show snapshot test results in the final test summary.
• Include snapshots in unified reporting for Fossil Test and Fossil Mock.
Describe alternatives you’ve considered
1. Manual Validation:
Developers manually check outputs by saving files and diffing them with tools like diff or git. This is tedious and not automated.
2. Custom Assertions:
Using custom assertions to check outputs against stored files. This provides partial automation but lacks integration with test frameworks.
Additional Context
• Use Cases:
• Validating API responses against known outputs.
• Checking console logs or error messages for consistency.
• Testing UI rendering outputs (e.g., HTML or JSON structures).
• Implementation Notes:
• Consider storing snapshot metadata (e.g., test environment details) alongside the snapshot.
• Offer options to ignore whitespace or specific fields when comparing snapshots.
The text was updated successfully, but these errors were encountered: