Skip to content

Commit 08eafdd

Browse files
committed
test: Fix bad caching of gomegas
Caching a gomega instance caused an invalid reuse of testing.T instances
1 parent 36c87e1 commit 08eafdd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/testing/gosttest/gomega_suite.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@ import (
1111
// automatically initializes gomega with
1212
type GomegaSuite struct {
1313
suite.Suite
14-
gomega gomega.Gomega
1514
}
1615

1716
// Expect is wraps [gomega/Gomega.Expect], passing the correct [testing/T]. This
1817
// supports gomega matchers for verification; which can in some cases provide
1918
// more expressive tests.
2019
func (s *GomegaSuite) Expect(actual interface{}, extra ...interface{}) types.Assertion {
21-
if s.gomega == nil {
22-
s.gomega = gomega.NewWithT(s.T())
23-
}
24-
return s.gomega.Expect(actual, extra...)
20+
return gomega.NewWithT(s.T()).Expect(actual, extra...)
2521
}

0 commit comments

Comments
 (0)