Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TInterface is now deprecated #162

Merged
merged 1 commit into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion goagen/gen_app/test_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (g *Generator) generateResourceTest() error {
codegen.SimpleImport("net/url"),
codegen.SimpleImport("strconv"),
codegen.SimpleImport("strings"),
codegen.SimpleImport("testing"),
codegen.SimpleImport("time"),
codegen.SimpleImport(appPkg),
codegen.NewImport("goa", "github.com/shogo82148/goa-v1"),
Expand Down Expand Up @@ -360,7 +361,7 @@ var testTmpl = `{{ define "convertParam" }}` + convertParamTmpl + `{{ end }}` +
// {{ $test.Name }} {{ $test.Comment }}
// If ctx is nil then context.Background() is used.
// If service is nil then a default service is created.
func {{ $test.Name }}(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl {{ $test.ControllerName}}{{/*
func {{ $test.Name }}(t testing.TB, ctx context.Context, service *goa.Service, ctrl {{ $test.ControllerName}}{{/*
*/}}{{ range $param := $test.Params }}, {{ $param.Name }} {{ $param.Pointer }}{{ $param.Type }}{{ end }}{{/*
*/}}{{ range $param := $test.QueryParams }}, {{ $param.Name }} {{ $param.Pointer }}{{ $param.Type }}{{ end }}{{/*
*/}}{{ range $header := $test.Headers }}, {{ $header.Name }} {{ $header.Pointer }}{{ $header.Type }}{{ end }}{{/*
Expand Down
2 changes: 1 addition & 1 deletion goagen/gen_app/test_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ var _ = Describe("Generate", func() {
// Multiple Routes
Ω(content).Should(ContainSubstring("ShowFooOK1("))
// Get returns an error media type
Ω(content).Should(ContainSubstring("GetFooOK(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.FooController, optionalResourceHeader *int, requiredResourceHeader string, payload app.CustomName) (http.ResponseWriter, error)"))
Ω(content).Should(ContainSubstring("GetFooOK(t testing.TB, ctx context.Context, service *goa.Service, ctrl app.FooController, optionalResourceHeader *int, requiredResourceHeader string, payload app.CustomName) (http.ResponseWriter, error)"))
})

It("generates the route path parameters", func() {
Expand Down
2 changes: 1 addition & 1 deletion goatest/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

// TInterface is an interface for Go's testing.T and testing.B.
//
// It is an alias of testing.TB.
// Deprecated: use testing.TB instead.
type TInterface = testing.TB

// ResponseSetterFunc func
Expand Down