Skip to content

Commit e14831f

Browse files
koct9ionsi
authored andcommitted
Add optionalDescription docs to AsyncAssertion and Assertion interfaces
And link documentation. Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
1 parent 344b94d commit e14831f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

types/types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ func MatchMayChangeInTheFuture(matcher GomegaMatcher, value any) bool {
6666

6767
// AsyncAssertions are returned by Eventually and Consistently and enable matchers to be polled repeatedly to ensure
6868
// they are eventually satisfied
69+
//
70+
// The optional optionalDescription argument allows you to annotate the assertion with additional information.
71+
// It is passed as the second argument and can be a format string followed by arguments, or a func() string.
72+
// The description is included in failure messages to provide context.
73+
//
74+
// For details on annotating assertions, see: https://onsi.github.io/gomega/#annotating-assertions
6975
type AsyncAssertion interface {
7076
Should(matcher GomegaMatcher, optionalDescription ...any) bool
7177
ShouldNot(matcher GomegaMatcher, optionalDescription ...any) bool
@@ -86,6 +92,12 @@ type AsyncAssertion interface {
8692
}
8793

8894
// Assertions are returned by Ω and Expect and enable assertions against Gomega matchers
95+
//
96+
// The optional optionalDescription argument allows you to annotate the assertion with additional information.
97+
// It is passed as the second argument and can be a format string followed by arguments, or a func() string.
98+
// The description is included in failure messages to provide context.
99+
//
100+
// For details on annotating assertions, see: https://onsi.github.io/gomega/#annotating-assertions
89101
type Assertion interface {
90102
Should(matcher GomegaMatcher, optionalDescription ...any) bool
91103
ShouldNot(matcher GomegaMatcher, optionalDescription ...any) bool

0 commit comments

Comments
 (0)