Tea
DocsPlaygroundExamplesReferenceCommunity
GitHub

Tea Language

A strongly typed scripting language for native tools.

© 2026 Tea Language.

ContributingCommunityRepository

Get Started

InstallationGetting StartedCLI

Language

SyntaxTypesFunctionsStructsGenericsPattern MatchingError HandlingModulesTesting

Project

Code StyleContributing

Language

Testing

Write `test` blocks in Tea and run them with `tea test`. Assertions live in `std.assert`.

Tea tests live in ordinary Tea files. Define test blocks, import assertion helpers from std.assert, and run everything through tea test.

Write a test block

A test block gives a named test case a small body of executable Tea code. Inside it, use assertion helpers to check expectations and fail fast when behavior changes.

use assert = "std.assert"

test "list length stays stable"
  var words = ["tea", "lang"]

  assert.ok(@len(words) == 2)
  assert.eq(words[0], "tea")
  assert.ne(words[1], "chai")
end

Assertion helpers

The standard assertion module covers the common cases: truthy checks, equality checks, inequality checks, and snapshot helpers when you want to compare output against stored expectations.

use assert = "std.assert"

test "basic assertions"
  assert.ok(1 + 1 == 2)
  assert.eq("tea", "tea")
  assert.ne("tea", "chai")
end

Run tests

Run the whole test suite or target a narrower path. The CLI can also list discovered tests or filter down to a subset when you only want to rerun one area.

tea test
tea test tests/
tea test --list
tea test --filter strings
tea test --update-snapshots

Current test surface

  • std.assert exports ok, eq, ne, and snapshot.
  • The CLI discovers Tea test blocks from paths you pass in.
  • Snapshot support exists in the stdlib and CLI surface, but backend support is still uneven.

Next steps

Continue to

std.assert

See the exact assertion helpers exported today.

Continue to

Contributing

Run the full repo test workflow.