Installation (Go)
Install the package
Section titled “Install the package”go get github.com/jagreehal/executable-stories/packages/executable-stories-goRequire Go 1.22 or later.
TestMain setup
Section titled “TestMain setup”Add a TestMain function to each test package that should produce a report. RunAndReport runs the tests and writes the raw run JSON before exiting:
package mypackage_test
import ( "os" "testing"
es "github.com/jagreehal/executable-stories/packages/executable-stories-go")
func TestMain(m *testing.M) { os.Exit(es.RunAndReport(m))}RunAndReport writes .executable-stories/raw-run.json by default. Set the EXECUTABLE_STORIES_OUTPUT environment variable to write to a different path.
Generate a report
Section titled “Generate a report”Pass the raw run JSON to executable-stories-formatters to render Markdown, HTML, JUnit XML, or Cucumber formats:
npx executable-stories-formatters format --input .executable-stories/raw-run.json --format markdownInstall the formatters package once in your Node project or CI job:
npm install -D executable-stories-formattersFirst Story (Go) — write your first Go scenario.
Go story & doc API — steps, docs, and adapter options.