fix(deps): update module github.com/onsi/gomega to v1.37.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2025-04-02 18:13:17 +00:00
committed by GitHub
parent 0d7ffeb1e9
commit 783f0c8076
7 changed files with 27 additions and 5 deletions

View File

@ -1,3 +1,8 @@
## 1.37.0
### Features
- add To/ToNot/NotTo aliases for AsyncAssertion [5666f98]
## 1.36.3
### Maintenance

View File

@ -22,7 +22,7 @@ import (
"github.com/onsi/gomega/types"
)
const GOMEGA_VERSION = "1.36.3"
const GOMEGA_VERSION = "1.37.0"
const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler.
If you're using Ginkgo then you probably forgot to put your assertion in an It().

View File

@ -145,12 +145,24 @@ func (assertion *AsyncAssertion) Should(matcher types.GomegaMatcher, optionalDes
return assertion.match(matcher, true, optionalDescription...)
}
func (assertion *AsyncAssertion) To(matcher types.GomegaMatcher, optionalDescription ...any) bool {
return assertion.Should(matcher, optionalDescription...)
}
func (assertion *AsyncAssertion) ShouldNot(matcher types.GomegaMatcher, optionalDescription ...any) bool {
assertion.g.THelper()
vetOptionalDescription("Asynchronous assertion", optionalDescription...)
return assertion.match(matcher, false, optionalDescription...)
}
func (assertion *AsyncAssertion) ToNot(matcher types.GomegaMatcher, optionalDescription ...any) bool {
return assertion.ShouldNot(matcher, optionalDescription...)
}
func (assertion *AsyncAssertion) NotTo(matcher types.GomegaMatcher, optionalDescription ...any) bool {
return assertion.ShouldNot(matcher, optionalDescription...)
}
func (assertion *AsyncAssertion) buildDescription(optionalDescription ...any) string {
switch len(optionalDescription) {
case 0:

View File

@ -70,6 +70,11 @@ type AsyncAssertion interface {
Should(matcher GomegaMatcher, optionalDescription ...any) bool
ShouldNot(matcher GomegaMatcher, optionalDescription ...any) bool
// equivalent to above
To(matcher GomegaMatcher, optionalDescription ...any) bool
ToNot(matcher GomegaMatcher, optionalDescription ...any) bool
NotTo(matcher GomegaMatcher, optionalDescription ...any) bool
WithOffset(offset int) AsyncAssertion
WithTimeout(interval time.Duration) AsyncAssertion
WithPolling(interval time.Duration) AsyncAssertion