Migration Guide
Migration Guide from stretchr/testify v1
1. Update Import Path
2. Optional: Enable YAML Support
If you use YAMLEq assertions:
Without this import, YAML assertions will panic with a helpful error message.
3. Optional: Enable Colorized Output
Use go additional test flags or environment variables: TESTIFY_COLORIZED=true, TESTIFY_THEME=dark|light
4. Optional: Adopt Generic Assertions
For better type safety and performance:
See Generics Guide for complete migration guide.
5. Remove Suite/Mock Usage
Replace testify suites and mocks with:
- mockery for mocking
- Standard Go subtests for test organization
6. Remove HTTP Assertion Usage
If you used assert.HTTPSuccess, assert.HTTPStatusCode, etc., you’ll need to replace with standard HTTP testing or wait for potential reintroduction.
Breaking Changes Summary
Removed Packages
- ❌
suite- Use standard Go subtests - ❌
mock- Use mockery - ❌
http- May be reintroduced later
Removed Functions
- ❌ All deprecated functions from v1 removed
Behavior Changes
EqualValuesnow fails with function types (consistency withEqual)IsNonDecreasing/IsNonIncreasinglogic corrected (previously inverted)- Nil pointer identity handling corrected (
Same/NotSame)
Dependency Changes
- ✅ Zero external dependencies
- ✅ YAML support requires opt-in via
enable/yamlmodule