Releases: caiolandgraf/gest
v2.0.0-beta-3
Changelog
[v2.0.0-beta]
Refactor
- Mudança do pacote
gestparapackage main, tornando-o uma ferramenta de linha de comando.
New Features
- Implementação de parser para o output JSON de
go test. - Integração com
fsnotifypara modo de execução interativo/watch.
Breaking Changes
- Remoção da API interna de asserções em favor do parsing de resultados de testes existentes.
Update
- Ajuste nos exemplos para refletir a nova estrutura de importação.
v2.0.0-beta-2
Changelog
[v2.0.0-beta]
Refactor
- Mudança do pacote
gestparapackage main, tornando-o uma ferramenta de linha de comando.
New Features
- Implementação de parser para o output JSON de
go test. - Integração com
fsnotifypara modo de execução interativo/watch.
Breaking Changes
- Remoção da API interna de asserções em favor do parsing de resultados de testes existentes.
Update
- Ajuste nos exemplos para refletir a nova estrutura de importação.
v2.0.0-beta
Changelog
[v2.0.0-beta]
Refactor
- Mudança do pacote
gestparapackage main, tornando-o uma ferramenta de linha de comando.
New Features
- Implementação de parser para o output JSON de
go test. - Integração com
fsnotifypara modo de execução interativo/watch.
Breaking Changes
- Remoção da API interna de asserções em favor do parsing de resultados de testes existentes.
Update
- Ajuste nos exemplos para refletir a nova estrutura de importação.
v2.0.5 — fix Time: display (was inflated up to 3x)
What's changed
Bug fixes
Time: was reporting inflated values — with multiple suites in the same package (e.g. TestBookIntegration, TestBook, TestUser all in internal/tests/), the reported time could be 3× the real value.
Root cause: two bugs in parseStream:
- The package-level
passevent was overwritings.elapsedof every suite in the package with the package wall-clock. With 3 suites sharing one package this multiplied the total by 3 (1.8sinstead of~0.5s). - The top-level
TestXxxelapsed was being ignored when subtests had already accumulateds.elapsed, silently losing any setup time outsidet.Run()(e.g.config.Load(), DB connection).
Fix:
s.elapsednow always uses the top-levelTestXxxelapsed (real wall clock including setup outsidet.Run)Time:total is now derived from per-packagepkgResultevents — the actual wall-clock reported bygo test
# before (v2.0.4)
Time: 1.782s ← 3 suites × package elapsed
# after (v2.0.5)
Time: 471ms ← actual package wall-clock
v2.0.4 — enable go test cache
What's changed
Performance
- Remove
-vflag fromgo testinvocation — the-vflag unconditionally bypasses the Go test cache, causing everygestrun to recompile and re-execute even when nothing changed. - Replace
t.Logsentinel withfmt.PrintfinSuite.Run— thegest:describe:<name>marker is now emitted directly to stdout, whichgo test -jsoncaptures as anoutputevent regardless of-v. The parser is unaffected.
Result
Repeated runs on an unchanged codebase now hit the Go test cache. In practice this brings gest execution time close to bare go test on warm runs.
# before (v2.0.3) — cache never used
grove test 1.884s
# after (v2.0.4) — cache used on repeated runs
grove test ~0.3s
go test ~0.3s
v2.0.3 — Fix: one suite per Describe
What's changed
🐛 Bug fixes
- CLI now renders one suite per
Describe()instead of grouping everything under the package name - The
Describe("name")label is now correctly shown as the suite header in the output - Each
It()description is now listed as an individual test item under its suite - Duplicate subtest names (Go's
#01suffix) are now collapsed cleanly
🔧 How it works
Suite.Run() emits a t.Log("gest:describe:name") sentinel that the CLI picks up from the go test -json stream and uses as the suite display name.
Installation
go install github.com/caiolandgraf/gest/v2/cmd/gest@latestLibrary
go get github.com/caiolandgraf/gest/v2gest v2.0.2 — Jest-style testing for Go 🧪
gest v2.0.0 — Jest-style testing for Go 🧪
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[2.0.0] — 2026-03-04
Overview
v2 is a ground-up rethink of how gest works. The library is now a pure assertion layer — Describe, It, Expect and matchers — that delegates execution entirely to the native go test engine via Suite.Run(t). A new standalone CLI (cmd/gest) replaces the old main.go / go run . workflow with a single gest ./... command that renders beautiful Jest-style output by parsing go test -v -json.
Added
-
cmd/gest— standalone CLI- Parses the
go test -v -jsonevent stream and renders colorized, Jest-style output. - Per-suite
PASS/FAILbadges, test names with✓/✕icons and timing. - Failure blocks with
Expected/Receiveddiffs and source code snippets. - Summary line:
Test Suites,Tests,Time— identical feel to Jest. --coverage/-cflag: per-suite pass-rate table with pip-style progress bars.--watch/-wflag: re-runsgo teston every.gofile change with a 30 ms debounce and full terminal clear between runs.- Install globally with
go install github.com/caiolandgraf/gest/cmd/gest@latest.
- Parses the
-
Suite.Run(t *testing.T)- New method that hands off each
It()case tot.Run()as a native Go subtest. - Enables IDE test runners,
go test -run, caching and-raceto all work out of the box.
- New method that hands off each
-
Source snippet in failure output
- Failed assertions now show the surrounding lines of source code with a
>pointer to the exact failing line, both ingo testoutput and in the gest CLI.
- Failed assertions now show the surrounding lines of source code with a
-
shortPathusingfilepath.Rel- Failure messages now show clean relative paths (e.g.
calculator_test.go:14) instead of absolute paths.
- Failure messages now show clean relative paths (e.g.
-
Improved caller detection
caller()now walks the stack past gest internals to always report the user's assertion line, not an internal gest line.
-
ToBeNilhandles more kinds- Now correctly handles
slice,map,chanandfuncin addition toptrandinterface.
- Now correctly handles
-
ToBeGreaterThan/ToBeLessThanacceptinterface{}- No longer require the argument to be typed as
float64— any numeric type works.
- No longer require the argument to be typed as
-
Migration guide
- New
## Migrating from v1section inREADME.mdwith a comparison table and step-by-step instructions. - New Migrating from v1 page section in the documentation site with before/after code blocks and a numbered checklist.
- New
Changed
-
Test files are now standard
_test.gofiles- The
examples/directory was migrated from*_spec.go+main.goto standard*_test.gofiles. This is the expected pattern for all v2 projects.
- The
-
go.modminimum version bumped togo 1.23- Removes the accidental
go 1.25.7entry that would breakgo getfor all users.
- Removes the accidental
-
gest/gestpackage is now dependency-freefsnotifyis no longer imported by the library. It is only used bycmd/gest. Projects that only use the assertion lib no longer pull in any external dependency.
Removed
Register(s *Suite)— global suite registry, no longer needed.RunRegistered()— entry point that reados.Argsand calledRunAll. Replaced bySuite.Run(t)+ the CLI.RunAll(suites ...*Suite)— internal runner that executed suites and printed output directly. Output rendering moved entirely tocmd/gest.WatchTests(args []string)— watch mode built into the lib. Replaced bygest --watch ./....watchBuildAndRun/watchSetupCleanup/watchAddDirs— internal watch helpers.Suite.run()— internal method that ran tests outsidego test. Replaced bySuite.Run(t).Suite.printHeader()/Suite.printFailures()— internal print methods. Output is now owned bycmd/gest.printCoverageTable/coverageBar/pctToColor— coverage rendering helpers moved tocmd/gest.examples/main.go— thego run .entry point is gone. Usegest ./...instead.examples/.gest/runner— stale v1 build artifact removed from version control.
Migration from v1
See the Migrating from v1 section in the documentation, or the ## Migrating from v1 section in README.md for full details.
Short version:
// v1 — calculator_spec.go
package main
import "github.com/caiolandgraf/gest/gest"
var s = gest.Describe("calculator")
func init() {
s.It("adds", func(t *gest.T) { ... })
gest.Register(s)
}
// v1 — main.go
func main() { gest.RunRegistered() }// v2 — calculator_test.go
package mypackage
import (
"testing"
"github.com/caiolandgraf/gest/gest"
)
func TestCalculator(t *testing.T) {
s := gest.Describe("calculator")
s.It("adds", func(t *gest.T) { ... })
s.Run(t)
}[0.1.0] — 2024-01-01
- Initial release of gest.
Describe/It/ExpectAPI with 10 built-in matchers.Register/RunRegisteredexecution model viago run ..- Watch mode built into the library via
fsnotify. - Coverage table with pip-style progress bars.
- ANSI truecolor output.
Full Changelog: v1.1.2...v2.0.0
gest v1.1.2 — Jest-style testing for Go 🧪
Release notes — v1.1.2
-- only update time of watch :D
✨ New feature: Watch Mode
gest now ships with a built-in watch mode. No extra tools, no config — just a flag.
go run . --watch # watch mode
go run . -w # shorthand
go run . --watch -c # watch + coverage tableHow it works:
- Runs immediately on startup — you see results before any file changes
- Watches all
.gofiles recursively from the current working directory (skipsvendor/and hidden dirs like.git/) - Debounced re-runs — rapid saves (e.g. editor auto-format on save) are collapsed into a single re-run via a 200 ms debounce
- Full terminal clear before every re-run, including scrollback — each result appears fresh at the top
- Compiled binary — builds your project to a temp binary in your OS temp directory (
go build) for the session; much cleaner thango runon every change - Automatic cleanup — the temp binary is removed when you press
Ctrl+C(SIGINT or SIGTERM). Nothing is left in your project directory
🔧 Implementation details
All watch logic lives directly in gest/gest.go, consistent with the project's single-file philosophy. The flag is parsed inside RunRegistered(), so existing main.go files require zero changes.
📦 Dependency added
github.com/fsnotify/fsnotify v1.9.0 — the only external dependency gest has ever added. Used exclusively by watch mode; the core test runner remains stdlib only.
📝 Docs & copy updated
- Navbar version badge:
v1.0→v1.1.0 - Hero badge:
v1.0.0 — Now available→v1.1.0 — Now available - "Zero dependencies" updated to "Minimal dependencies" across README, docs site, footer, search index, and philosophy sections
- New Watch Mode section in the documentation with code examples and callouts
- Watch Mode added to the sidebar nav and the search modal index
- Docs site rebuilt (
dist/)
Full Changelog: v1.1.1...v1.1.2
gest v1.1.1 — Jest-style testing for Go 🧪
Release notes — v1.1.1
-- only update time of watch :D
✨ New feature: Watch Mode
gest now ships with a built-in watch mode. No extra tools, no config — just a flag.
go run . --watch # watch mode
go run . -w # shorthand
go run . --watch -c # watch + coverage tableHow it works:
- Runs immediately on startup — you see results before any file changes
- Watches all
.gofiles recursively from the current working directory (skipsvendor/and hidden dirs like.git/) - Debounced re-runs — rapid saves (e.g. editor auto-format on save) are collapsed into a single re-run via a 200 ms debounce
- Full terminal clear before every re-run, including scrollback — each result appears fresh at the top
- Compiled binary — builds your project to a temp binary in your OS temp directory (
go build) for the session; much cleaner thango runon every change - Automatic cleanup — the temp binary is removed when you press
Ctrl+C(SIGINT or SIGTERM). Nothing is left in your project directory
🔧 Implementation details
All watch logic lives directly in gest/gest.go, consistent with the project's single-file philosophy. The flag is parsed inside RunRegistered(), so existing main.go files require zero changes.
📦 Dependency added
github.com/fsnotify/fsnotify v1.9.0 — the only external dependency gest has ever added. Used exclusively by watch mode; the core test runner remains stdlib only.
📝 Docs & copy updated
- Navbar version badge:
v1.0→v1.1.0 - Hero badge:
v1.0.0 — Now available→v1.1.0 — Now available - "Zero dependencies" updated to "Minimal dependencies" across README, docs site, footer, search index, and philosophy sections
- New Watch Mode section in the documentation with code examples and callouts
- Watch Mode added to the sidebar nav and the search modal index
- Docs site rebuilt (
dist/)
Full Changelog: v1.1.0...v1.1.1