📖 2 min read (~ 300 words).

Assertions index

The v2 our tests wanted

The testify/v2 package has a fairly large API surface.

This is in part inherited from the original testify and also largely due to the many available variants of the same assertion function.

The following sections organize the assertion API into usage domains, with all documented exported variants documented in a more concise form than the reference godoc documentation.

GoDoc

Domains

The testify API is organized in 18 logical domains shown below. Each domain contains assertions regrouped by their use case (e.g. http, json, error).

  • Expressing Assertions Using Conditions
  • Asserting OS Files
  • Asserting HTTP Response And Body
  • Asserting JSON Documents
  • Asserting How Collections Are Ordered
  • Asserting A Panic Behavior
  • Mimicks Methods From The Testing Standard Library
  • Asserting Times And Durations
  • Asserting Types Rather Than Values
  • Asserting Yaml Documents
  • Other Uncategorized Helpers

  • Boolean - Asserting Boolean Values (4)
  • Collection - Asserting Slices And Maps (19)
  • Comparison - Comparing Ordered Values (12)
  • Condition - Expressing Assertions Using Conditions (4)
  • Equality - Asserting Two Things Are Equal (16)
  • Error - Asserting Errors (8)
  • File - Asserting OS Files (6)
  • Http - Asserting HTTP Response And Body (7)
  • Json - Asserting JSON Documents (3)
  • Number - Asserting Numbers (7)
  • Ordering - Asserting How Collections Are Ordered (10)
  • Panic - Asserting A Panic Behavior (4)
  • String - Asserting Strings (4)
  • Testing - Mimicks Methods From The Testing Standard Library (2)
  • Time - Asserting Times And Durations (2)
  • Type - Asserting Types Rather Than Values (10)
  • Yaml - Asserting Yaml Documents (3)
  • Common - Other Uncategorized Helpers (4)

Generated with github.com/go-openapi/testify/codegen/v2