/echonext:echonext-testingfrom echonext
Write tests for EchoNext APIs using in-process APIClient, Suite, and FixtureManager helpers.
Ships in echonext. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
pkg/contrib/testing provides in-process HTTP testing for echonext apps: build
your *echonext.App, drive it with an APIClient (no real network), and assert
on typed responses. A Suite bundles the app, DB, client, and fixtures with
setup/teardown.
import (
"testing"
echotest "github.com/abdussamadbello/echonext/pkg/contrib/testing"
)
func TestCreateTodo(t *testing.T) {
app := buildApp() // your function that wires routes onto echonext.New()
client := echotest.NewAPIClient(app)
resp := client.POST("/todos", map[string]any{"title": "write tests"})
if resp.Status() != 201 {
t.Fatalf("got %d: %s", resp.Status(), resp.String())
}
var out struct {
Data Todo `json:"data"`
Success bool `json:"success"`
}
if err := resp.JSON(&out); err != nil {
t.Fatal(err)
}
if out.Data.Title != "write tests" {
t.Fatalf("unexpected title: %q", out.Data.Title)
}
}
APIClient methods:
GET(path), POST(path, body), PUT(path, body),
PATCH(path, body), DELETE(path) — each returns a *Response.WithHeader(key, value), WithAuth(token) (Bearer),
WithBasicAuth(user, pass).*Response: Status() int, JSON(target any) error, String() string,
Error() error.Remember responses are wrapped in Response[T] — decode into a struct with
Data/Success/Error fields (see the echonext-handlers skill).
resp := client.
WithAuth("test-jwt").
GET("/me")
func TestUsersSuite(t *testing.T) {
app := buildApp()
db := openTestDB(t) // *gorm.DB, e.g. in-memory sqlite
s := echotest.NewSuite(app, db)
if err := s.Setup(); err != nil {
t.Fatal(err)
}
defer s.Teardown()
// Seed rows for this test:
if err := s.LoadFixtures(
&User{ID: 1, Email: "[email protected]"},
&User{ID: 2, Email: "[email protected]"},
); err != nil {
t.Fatal(err)
}
resp := s.Client.GET("/users") // shared client
authed := s.WithAuth("token").GET("/me") // per-request auth
_ = authed
if resp.Status() != 200 {
t.Fatalf("got %d", resp.Status())
}
}
Suite fields: App, DB, Client *APIClient, Fixtures *FixtureManager.
Methods: Setup(), Teardown(), LoadFixtures(records ...any),
WithAuth(token) *APIClient.
When you don't need a full suite:
fm := echotest.NewFixtureManager(db)
fm.Load(&User{ID: 1, Email: "[email protected]"}) // insert one/several records
fm.LoadMany(users) // insert a slice
fm.ClearTable("users") // truncate one table
fm.ClearAll() // clear all known fixtures
echonext test # framework test runner
echonext test -- -run TestX # pass-through flags after --
go test ./... # or plain Go
*echonext.App your main builds, then NewAPIClient(app).{ Data, Success, Error } wrapper, not the bare model.resp.Status(); print resp.String() on failure for context.Suite when you need a DB + fixtures + teardown; otherwise just the
APIClient.echonext db seed.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/echonext-cliUse the EchoNext CLI to scaffold projects and code, run the dev loop, build, test, and manage the database. Use when creating a new echonext project, generating code (domain/handler/service/model/dto/middleware/openapi/graphql/ websocket/upload), or running dev/build/test/db commands./echonext-databaseWork with EchoNext's database layer: GORM models, the generic Repository[T] pattern from pkg/contrib/database, and Atlas migrations/seeds via the CLI. Use when defining models, querying/persisting data, or creating and applying migrations in an echonext project./echonext-domainScaffold and wire up a complete EchoNext domain (model + service + handler + DTO) following the framework's conventional layout. Use when adding a new resource, feature, or entity to an echonext project (e.g. "add a users endpoint", "create a products domain")./echonext-handlersWrite and register type-safe EchoNext HTTP handlers, request structs, and routes. Use when adding, editing, or debugging an echonext handler function, a request/response struct, validation tags, or a route registration (GET/POST/PUT/PATCH/DELETE)./echonext-integrationsAdd WebSocket, GraphQL, or file-upload endpoints to an EchoNext app. Use when building real-time/WebSocket handlers (Hub pattern), wiring a gqlgen GraphQL schema, or accepting multipart file uploads with validation./echonext-middleware-configRegister, order and write EchoNext middleware, and load application configuration. Use when adding middleware (auth, CORS, logging, request IDs, metrics, tracing) to an echonext app or group, writing a custom echo.MiddlewareFunc, or loading config from YAML/env with the contrib config package.npx claudepluginhub abdussamadbello/echonext --plugin echonextOther plugins' skills for the same job