Skip to content

Releases: caiolandgraf/gest

v2.0.0-beta-3

24 Apr 19:47
cea4614

Choose a tag to compare

Changelog

[v2.0.0-beta]

Refactor

  • Mudança do pacote gest para package 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 fsnotify para 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

24 Apr 19:35
f15c562

Choose a tag to compare

Changelog

[v2.0.0-beta]

Refactor

  • Mudança do pacote gest para package 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 fsnotify para 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

24 Apr 19:30
69d9376

Choose a tag to compare

Changelog

[v2.0.0-beta]

Refactor

  • Mudança do pacote gest para package 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 fsnotify para 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)

04 Mar 20:01
ac7ec0c

Choose a tag to compare

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:

  1. The package-level pass event was overwriting s.elapsed of every suite in the package with the package wall-clock. With 3 suites sharing one package this multiplied the total by 3 (1.8s instead of ~0.5s).
  2. The top-level TestXxx elapsed was being ignored when subtests had already accumulated s.elapsed, silently losing any setup time outside t.Run() (e.g. config.Load(), DB connection).

Fix:

  • s.elapsed now always uses the top-level TestXxx elapsed (real wall clock including setup outside t.Run)
  • Time: total is now derived from per-package pkgResult events — the actual wall-clock reported by go 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

04 Mar 19:51
cabbcf0

Choose a tag to compare

What's changed

Performance

  • Remove -v flag from go test invocation — the -v flag unconditionally bypasses the Go test cache, causing every gest run to recompile and re-execute even when nothing changed.
  • Replace t.Log sentinel with fmt.Printf in Suite.Run — the gest:describe:<name> marker is now emitted directly to stdout, which go test -json captures as an output event 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

04 Mar 16:35
ce63c55

Choose a tag to compare

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 #01 suffix) 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@latest

Library

go get github.com/caiolandgraf/gest/v2

gest v2.0.2 — Jest-style testing for Go 🧪

04 Mar 16:26
e3975e0

Choose a tag to compare

gest v2.0.0 — Jest-style testing for Go 🧪

04 Mar 15:58
2b6bc14

Choose a tag to compare

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 layerDescribe, 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 -json event stream and renders colorized, Jest-style output.
    • Per-suite PASS / FAIL badges, test names with / icons and timing.
    • Failure blocks with Expected / Received diffs and source code snippets.
    • Summary line: Test Suites, Tests, Time — identical feel to Jest.
    • --coverage / -c flag: per-suite pass-rate table with pip-style progress bars.
    • --watch / -w flag: re-runs go test on every .go file change with a 30 ms debounce and full terminal clear between runs.
    • Install globally with go install github.com/caiolandgraf/gest/cmd/gest@latest.
  • Suite.Run(t *testing.T)

    • New method that hands off each It() case to t.Run() as a native Go subtest.
    • Enables IDE test runners, go test -run, caching and -race to all work out of the box.
  • Source snippet in failure output

    • Failed assertions now show the surrounding lines of source code with a > pointer to the exact failing line, both in go test output and in the gest CLI.
  • shortPath using filepath.Rel

    • Failure messages now show clean relative paths (e.g. calculator_test.go:14) instead of absolute paths.
  • Improved caller detection

    • caller() now walks the stack past gest internals to always report the user's assertion line, not an internal gest line.
  • ToBeNil handles more kinds

    • Now correctly handles slice, map, chan and func in addition to ptr and interface.
  • ToBeGreaterThan / ToBeLessThan accept interface{}

    • No longer require the argument to be typed as float64 — any numeric type works.
  • Migration guide

    • New ## Migrating from v1 section in README.md with 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.

Changed

  • Test files are now standard _test.go files

    • The examples/ directory was migrated from *_spec.go + main.go to standard *_test.go files. This is the expected pattern for all v2 projects.
  • go.mod minimum version bumped to go 1.23

    • Removes the accidental go 1.25.7 entry that would break go get for all users.
  • gest/gest package is now dependency-free

    • fsnotify is no longer imported by the library. It is only used by cmd/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 read os.Args and called RunAll. Replaced by Suite.Run(t) + the CLI.
  • RunAll(suites ...*Suite) — internal runner that executed suites and printed output directly. Output rendering moved entirely to cmd/gest.
  • WatchTests(args []string) — watch mode built into the lib. Replaced by gest --watch ./....
  • watchBuildAndRun / watchSetupCleanup / watchAddDirs — internal watch helpers.
  • Suite.run() — internal method that ran tests outside go test. Replaced by Suite.Run(t).
  • Suite.printHeader() / Suite.printFailures() — internal print methods. Output is now owned by cmd/gest.
  • printCoverageTable / coverageBar / pctToColor — coverage rendering helpers moved to cmd/gest.
  • examples/main.go — the go run . entry point is gone. Use gest ./... 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 / Expect API with 10 built-in matchers.
  • Register / RunRegistered execution model via go 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 🧪

04 Mar 13:10
95ac853

Choose a tag to compare

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 table

How it works:

  • Runs immediately on startup — you see results before any file changes
  • Watches all .go files recursively from the current working directory (skips vendor/ 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 than go run on 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.0v1.1.0
  • Hero badge: v1.0.0 — Now availablev1.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 🧪

04 Mar 13:02
b3f0cec

Choose a tag to compare

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 table

How it works:

  • Runs immediately on startup — you see results before any file changes
  • Watches all .go files recursively from the current working directory (skips vendor/ 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 than go run on 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.0v1.1.0
  • Hero badge: v1.0.0 — Now availablev1.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