Open howardtw opened 5 years ago
It's not that we cannot put non-test functions in *_test.go
. It's totally fine to put test helper function in *_test.go
. However, if we want to define a struct like this
type HTTPT struct {
Assert *Assertions
App *App
RH test.RequestHelper
*test.T
}
and create a bunch of methods on top, then it makes more sense to put it at a httptest
package, so actions
package can also use it for example.
https://github.com/stellar/go/blob/master/services/horizon/internal/helpers_test.go https://github.com/stellar/go/blob/master/services/horizon/internal/httpt_test.go https://github.com/stellar/go/blob/master/services/horizon/internal/assertions_test.go