Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/doc-site/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Testify v2"
type: home
description: 'The v2 our test wanted'
description: 'The v2 our tests wanted'
weight: 1
---

Expand Down Expand Up @@ -167,4 +167,4 @@ See also our [CONTRIBUTING guidelines](./project/contributing/CONTRIBUTING.md).

{{< children type="card" description="true" >}}

[doc-examples]: ./usage/examples
[doc-examples]: ./usage/EXAMPLES.md
2 changes: 1 addition & 1 deletion docs/doc-site/api/_index.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comes from doc generator. Have to fix the original source ./internal/assertions/doc.go

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Each domain contains assertions regrouped by their use case (e.g. http, json, er
- [Ordering](./ordering.md) - Asserting How Collections Are Ordered (10)
- [Panic](./panic.md) - Asserting A Panic Behavior (4)
- [String](./string.md) - Asserting Strings (4)
- [Testing](./testing.md) - Mimicks Methods From The Testing Standard Library (2)
- [Testing](./testing.md) - Mimics Methods From The Testing Standard Library (2)
- [Time](./time.md) - Asserting Times And Durations (2)
- [Type](./type.md) - Asserting Types Rather Than Values (10)
- [Yaml](./yaml.md) - Asserting Yaml Documents (3)
Expand Down
4 changes: 2 additions & 2 deletions docs/doc-site/api/testing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Testing"
description: "Mimicks Methods From The Testing Standard Library"
description: "Mimics Methods From The Testing Standard Library"
modified: 2026-01-27
weight: 14
domains:
Expand All @@ -12,7 +12,7 @@ keywords:
- "FailNowf"
---

Mimicks Methods From The Testing Standard Library
Mimics Methods From The Testing Standard Library

## Assertions

Expand Down
2 changes: 1 addition & 1 deletion docs/doc-site/project/APPROACH.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ standards, then **assertion-style testing is the natural extension of those valu

BDD frameworks serve teams with different priorities (narrative specifications, framework-managed workflows, stakeholder
communication). Those are valid priorities. But they optimize for values orthogonal to Go's design philosophy.
For such teams, **Ginkgo/Omega** provides a great BDD testing framework.
For such teams, **Ginkgo/Gomega** provides a great BDD testing framework.

**For Go developers who embrace Go values, assertion-style testing is the idiomatic approach.**. And **testify** is the tool.

Expand Down
2 changes: 1 addition & 1 deletion docs/doc-site/project/MOTIVATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ APIs that became bloated over a decade or so, uncontrolled dependencies, difficu
breaking changes, conflicting demands from users etc.
{{% /notice %}}

You might also be curious about our [ROADMAP](project/maintainers/ROADMAP.md).
You might also be curious about our [ROADMAP](./maintainers/ROADMAP.md).

---

Expand Down
8 changes: 4 additions & 4 deletions docs/doc-site/usage/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ See also a quick [migration guide](./MIGRATION.md).

**Origin**: Generic initiative + [#1685] (partial - SeqContains variants only)

**Performance**: 16-81x faster than reflection-based variants (see [benchmarks](../../project/maintainers/BENCHMARKS.md))
**Performance**: 16-81x faster than reflection-based variants (see [benchmarks](../project/maintainers/BENCHMARKS.md))

[#1685]: https://github.com/stretchr/testify/pull/1685
{{% /expand %}}
Expand Down Expand Up @@ -464,7 +464,7 @@ Removed extraneous type declaration `PanicTestFunc` (`func()`).

### Performance Improvements

See [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) for a detailed presentation.
See [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) for a detailed presentation.

#### Generic vs Reflection Performance

Expand Down Expand Up @@ -532,7 +532,7 @@ github.com/go-openapi/testify/v2 # Core (zero deps) [go.mod]
| **Generated functions** | ~600 (76 × 8 variants - generics get 4 variants only) |
| **Generic coverage** | 10 domains |
| **Performance improvement** | 1.2x to 81x faster |
| **Dependencies** | 0 external (was 2 requiredl) |
| **Dependencies** | 0 external (was 2 required) |
| **Test coverage** | 96% overall, 100% on public APIs |
| **Documentation domains** | 18 logical categories |

Expand All @@ -542,7 +542,7 @@ github.com/go-openapi/testify/v2 # Core (zero deps) [go.mod]

- [Migration Guide](./MIGRATION.md) - Step-by-step guide to migrating from testify v1
- [Generics Guide](./GENERICS.md) - Detailed documentation of all 38 generic assertions
- [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) - Comprehensive performance analysis
- [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) - Comprehensive performance analysis
- [Examples](./EXAMPLES.md) - Practical usage examples showing new features
- [Tutorial](./TUTORIAL.md) - Best practices for writing tests with testify v2
- [API Reference](../api/_index.md) - Complete assertion catalog organized by domain
Expand Down
19 changes: 8 additions & 11 deletions docs/doc-site/usage/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestCalculator(t *testing.T) {
import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/go-openapi/testify/v2/assert"
)

func TestUser(t *testing.T) {
Expand All @@ -54,8 +54,7 @@ func TestUser(t *testing.T) {
import (
"testing"

"github.com/stretchr/testify/assert"

"github.com/go-openapi/testify/v2/assert"
"github.com/go-openapi/testify/v2/require"
)

Expand Down Expand Up @@ -210,8 +209,7 @@ Testify provides multiple ways to call assertions:
import (
"testing"

"gotest.tools/assert"

"github.com/go-openapi/testify/v2/assert"
"github.com/go-openapi/testify/v2/require"
)

Expand Down Expand Up @@ -291,7 +289,7 @@ import (
"slices"
"testing"

"gotest.tools/assert"
"github.com/go-openapi/testify/v2/assert"
)

func TestAdd(t *testing.T) {
Expand Down Expand Up @@ -456,17 +454,16 @@ func TestPanics(t *testing.T) {
import (
"testing"

"gotest.tools/assert"

"github.com/go-openapi/testify/v2/assert"
"github.com/go-openapi/testify/v2/require"
)

func TestWithSetup(t *testing.T) {
// Setup
db := setupTestDatabase(t)
t.Cleanup(func() {
db.Close() // Teardown
})
t.Cleanup(func() {
db.Close() // Teardown
})

// Test
user := &User{Name: "Alice"}
Expand Down
10 changes: 5 additions & 5 deletions docs/doc-site/usage/GENERICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestUser(t *testing.T) {
// actualOrder ✗ (wrong type - grayed out)
```

4. **Performance-critical tests** - See [benchmarks](../../project/maintainers/BENCHMARKS.md) for 1.2-81x speedups
4. **Performance-critical tests** - See [benchmarks](../project/maintainers/BENCHMARKS.md) for 1.2-81x speedups

### 🔄 Use Reflection Variants (no suffix) When:

Expand Down Expand Up @@ -236,7 +236,7 @@ Testify v2 provides generic variants across all major domains:
- `YAMLEqT[S Text]` - YAML strings are semantically equal

{{% notice style="info" title="See Complete API" icon="book" %}}
For a detailed documentation of all generic functions, see the [API Reference](../../api/_index.md) organized by domain.
For a detailed documentation of all generic functions, see the [API Reference](../api/_index.md) organized by domain.
{{% /notice %}}

## Practical Examples
Expand Down Expand Up @@ -527,7 +527,7 @@ Generic assertions provide significant performance improvements, especially for
| **SliceContainsT** | **16x faster** | Collection membership tests |

{{% notice style="success" title="Learn More" icon="chart-line" %}}
See the complete [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) for detailed analysis and real benchmark results.
See the complete [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) for detailed analysis and real benchmark results.
{{% /notice %}}

## Best Practices
Expand Down Expand Up @@ -624,7 +624,7 @@ Generic assertions use custom type constraints defined in `internal/assertions/g
- **Format variants**: Add `Tf` suffix (e.g., `EqualTf`, `GreaterTf`)
- **When to use**: Prefer generics for known concrete types
- **When not to**: Keep reflection for dynamic types and cross-type comparisons
- **Performance**: See [benchmarks](../../project/maintainers/BENCHMARKS.md) for dramatic speedups
- **Performance**: See [benchmarks](../project/maintainers/BENCHMARKS.md) for dramatic speedups
{{% /notice %}}

---
Expand All @@ -634,6 +634,6 @@ Generic assertions use custom type constraints defined in `internal/assertions/g
- [Examples](./EXAMPLES.md) - Practical examples including generic assertion usage
- [Tutorial](./TUTORIAL.md) - Best practices for writing tests with testify
- [Usage Guide](./USAGE.md) - API conventions and naming patterns
- [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) - Detailed performance analysis of generic vs reflection
- [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) - Detailed performance analysis of generic vs reflection
- [Changes from v1](./CHANGES.md) - Complete list of new generic functions and improvements
- [API Reference](../api/_index.md) - Complete assertion catalog with all generic variants
2 changes: 1 addition & 1 deletion docs/doc-site/usage/TRACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ We continue to monitor and selectively adopt changes from the upstream repositor
[#1822]: https://github.com/stretchr/testify/issues/1822
[#1825]: https://github.com/stretchr/testify/pull/1825
[#1828]: https://github.com/stretchr/testify/pull/1828
[1829]: https://github.com/stretchr/testify/issues/1829
[#1829]: https://github.com/stretchr/testify/issues/1829

## Appendix: Upstream References

Expand Down
6 changes: 3 additions & 3 deletions docs/doc-site/usage/TUTORIAL.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect imports have been inserted by mdsf. Have to check why on next run

Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Instead of writing separate test functions for each case:
import (
"testing"

"gotest.tools/assert"
"github.com/go-openapi/testify/v2/assert"
)

// ❌ Don't do this - repetitive and hard to maintain
Expand Down Expand Up @@ -255,7 +255,7 @@ func TestAdd(t *testing.T) {
import (
"testing"

"gotest.tools/assert"
"github.com/go-openapi/testify/v2/assert"
)

func TestAdd(t *testing.T) {
Expand Down Expand Up @@ -470,7 +470,7 @@ Always use `t.Parallel()` unless you have a specific reason not to:
import (
"testing"

"gotest.tools/assert"
"github.com/go-openapi/testify/v2/assert"
)

func TestAdd(t *testing.T) {
Expand Down
32 changes: 17 additions & 15 deletions docs/doc-site/usage/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ Assertions are grouped by domain for easier discovery:
| **Others** | HTTP, JSON, YAML, Time, File assertions | 12 |

{{% notice style="info" title="Browse by Domain" icon="book" %}}
See the complete [API Reference](../../api/_index.md) organized by domain for a detailed documentation of all assertions.
See the complete [API Reference](../api/_index.md) organized by domain for a detailed documentation of all assertions.
{{% /notice %}}

## Navigating the Documentation

### Quick Reference

- **[Examples](../examples)** - Practical code examples for common testing scenarios
- **[API Reference](../../api/_index.md)** - Complete assertion catalog organized by domain
- **[Examples](./EXAMPLES.md)** - Practical code examples for common testing scenarios
- **[API Reference](../api/_index.md)** - Complete assertion catalog organized by domain
- **[Generics Guide](../GENERICS.md)** - Using type-safe assertions with the `T` suffix
- **[Changes](../CHANGES.md)** - All changes since fork from stretchr/testify
- **[pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2)** - godoc API reference with full signatures

### Finding the Right Assertion

1. Browse the [API Reference](../../api/_index.md) by domain (e.g., "Collection" for slice operations)
2. Search in the [API Reference](../../api/_index.md) (use search box)
3. Check (or search) the provided [Examples](../examples) for practical usage patterns
1. Browse the [API Reference](../api/_index.md) by domain (e.g., "Collection" for slice operations)
2. Search in the [API Reference](../api/_index.md) (use search box)
3. Check (or search) the provided [Examples](./EXAMPLES.md) for practical usage patterns
4. Check [pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2/assert) for alphabetical listing
5. Use your editor's Go to Definition on any assertion
6. Use your IDE's autocomplete - type `assert.` and explore
Expand Down Expand Up @@ -262,7 +262,7 @@ assert.Eventually(t, condition, waitFor, tick) // Condition first, timing p

{{% notice style="tip" title="Finding Argument Order" icon="lightbulb" %}}
When unsure about argument order:
- Check the [API Reference](../../api/_index.md) for detailed signatures
- Check the [API Reference](../api/_index.md) for detailed signatures
- Use IDE autocomplete to see parameter names
- Consult [pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2/assert) for complete documentation
{{% /notice %}}
Expand Down Expand Up @@ -328,7 +328,7 @@ import (
"slices"
"testing"

"gotest.tools/assert"
"github.com/go-openapi/testify/v2/assert"
)

func TestCalculation(t *testing.T) {
Expand Down Expand Up @@ -428,19 +428,21 @@ func TestTypeSafety(t *testing.T) {

1. **Import the package:**
```go
import "github.com/go-openapi/testify/v2/assert"
// or
import "github.com/go-openapi/testify/v2/require"
```

2. **Choose your style:**
- Package-level: `assert.Equal(t, expected, actual)`
- Forward methods: `a := assert.New(t); a.Equal(expected, actual)`

3. **Explore by domain:**
- Browse [API Reference](../../api/_index.md) to discover assertions
- Check [Examples](../examples) for practical patterns
- Browse [API Reference](../api/_index.md) to discover assertions
- Check [Examples](./EXAMPLES.md) for practical patterns

4. **Use generics for type safety:**
- See [Generics Guide](../GENERICS.md) for type-safe assertions
- See [Generics Guide](./GENERICS.md) for type-safe assertions
- Add `T` suffix for compile-time type checking

## Best Practices
Expand All @@ -462,9 +464,9 @@ func TestTypeSafety(t *testing.T) {

{{% notice style="success" title="Ready to Test" icon="check" %}}
**Next Steps:**
- Explore [Examples](../examples) for practical usage patterns
- Browse the [API Reference](../../api/_index.md) to discover assertions
- Read the [Generics Guide](../GENERICS.md) for type-safe testing
- Explore [Examples](./EXAMPLES.md) for practical usage patterns
- Browse the [API Reference](../api/_index.md) to discover assertions
- Read the [Generics Guide](./GENERICS.md) for type-safe testing
- Check [pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2) for complete reference
{{% /notice %}}

Expand Down Expand Up @@ -540,7 +542,7 @@ age: 30
Different YAML libraries offer different trade-offs:

**`gopkg.in/yaml.v3` (default):**
- De factor standard library for Go YAML
- De facto standard library for Go YAML
- Widely used and well-tested
- Complete YAML 1.2 support

Expand Down
Loading