Overview
Shouldly is a BDD-style assertion library for Dart and Flutter that prioritizes clear, descriptive error messages when tests fail. Designed to improve test readability and debugging efficiency, it offers a fluent API that reads like natural language. The library is extensible, allowing developers to customize assertions to fit specific project needs. It supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform testing workflows.
Use cases
- Writing readable and maintainable unit tests
- Improving test failure diagnostics
- Enhancing test-driven development workflows
- Cross-platform testing with consistent assertions
- Customizing assertion logic for domain-specific validation
Key features
- Fluent, human-readable assertion syntax
- Detailed and helpful error messages on failure
- Extensible assertion system
- Supports all Flutter platforms
- Intuitive BDD-style API
- Easy integration via pub add
Suitable for
- Developers seeking better test feedback
- Teams practicing TDD or BDD
- Projects requiring clear test output
- Cross-platform Flutter applications
- Test automation engineers
Considerations
- May require learning curve for new BDD users
- Additional dependency in test suites
- Limited to testing context (not runtime use)
- Not suitable for production code assertions
- Requires careful setup for custom assertions