Skip to content

Example projects

The varar-dev/varar-examples repository holds one small, standalone project per language/test-framework combination. Each is a complete project you can copy as the starting point for your own.

They all run the same Markdown oaths — including the ones you can try on the front page. The .md files are identical across projects; only the step definitions change language. That is the point: the oath belongs to the whole team, the language is an implementation detail.

TypeScript + Vitest

The full example set, and the project the interactive editors on this site mirror. Run with pnpm test.

Browse typescript-vitest →

Java + JUnit + Maven

Step definitions as StepDefinitions classes, run by the JUnit Platform var engine. Run with mvn test.

Browse java-junit-maven →

Java + JUnit + Gradle

The same Java step definitions as the Maven project, built with Gradle. Run with ./gradlew test.

Browse java-junit-gradle →

Kotlin + JUnit

Step definitions in the Kotlin DSL — top-level steps with state-receiver lambdas. Run with ./gradlew test.

Browse kotlin-junit →

Kotlin + Kotest

The same Kotlin step definitions, registered as a Kotest OathSpec instead of the JUnit suite. Run with ./gradlew test.

Browse kotlin-kotest →

Python + pytest

Step definitions as decorated functions, collected by the pytest-varar plugin. Run with uv run pytest.

Browse python-pytest →

Python + unittest

The same Python step definitions, generated into standard-library TestCase classes by varar-unittest. Run with uv run python -m unittest.

Browse python-unittest →

Ruby + RSpec

Step definitions in the block DSL — steps(...) do stimulus … sensor … end — collected as RSpec examples. Run with bundle exec rspec.

Browse ruby-rspec →

Ruby + Minitest

The same Ruby step definitions, run as Minitest tests instead. Run with bundle exec rake test.

Browse ruby-minitest →

Rust + cargo test

Step definitions added to an injected Steps builder, enumerated as libtest items. Run with cargo test.

Browse rust-cargotest →

C# + dotnet test

Step definitions registered through a Steps builder, collected by the Varar VSTest adapter. Run with dotnet test.

Browse csharp-vstest →

Go + go test

Step definitions added to an injected Steps builder, with every example reported as its own Go subtest. Run with go test.

Browse go-gotest →

The Rust, C# and Go samples live in the monorepo’s examples/ directory for now: they are synced to varar-examples once their registry publishing goes live (crates.io, NuGet and Go modules respectively).

The oaths sit in each project’s varar/ directory as plain .md files. typescript-vitest carries the full set; the other projects share a feature-covering subset:

Oath Shows
hello-varar.md basic stimulus/sensor steps
deep-thought.md the front page’s one-sensor example
library.md state evolving across arrange–act–assert, custom parameter types
roman-numerals.md header-bound table rows
yahtzee.md header-bound table rows over a richer domain
tables-and-docstrings.md whole-table and doc-string checks

The projects are synced from the varar-dev/varar monorepo’s examples/ directory on every release, pinned to the released package versions — so send changes there, not to varar-examples.