← Back to all sparks
T

testthat

INFRA · APIS
Velocity0.0

Unit testing framework for R packages

testthat now ships a reporter built for the coding agent running the tests.

testingcoding-agentsopentelemetrydeprecationsr-language
Current state
testthat is at 3.3.2, which added LlmReporter(), a reporter designed for LLM coding agents and used automatically inside Claude Code, Cursor and Gemini CLI, with AGENT=1 to opt any other agent in. The same release emits OpenTelemetry traces when tracing is enabled. It follows 3.3.0, a large lifecycle release that required R 4.1, made local_mock() and with_mock() defunct, and rewrote every expect_ failure message to state what was expected, what arrived and how they differ.
Where it's heading
Both threads point the same way: making test output legible to something other than a human reading a console. The 3.3.0 message rewrite made failures self-describing, and LlmReporter() plus OpenTelemetry take that to machine consumers — an agent parsing results and a tracing backend collecting them. The deprecation clean-out running underneath is the usual cost of getting there.
Prediction
With a reporter now shipped for coding agents and tracing behind optional packages, the next release most likely refines that reporter's output format rather than adding another consumer.

Recent moves

  1. 7mo ago

    testthat 3.3.2

    ⚡ SPARK

    testthat starts treating coding agents as a first-class consumer of test results, with a dedicated reporter that activates automatically inside the major agent tools. OpenTelemetry tracing lands in the same release, extending the machine-readable-output thread.

    View source ↗
  2. 8mo ago

    Fixes shinytest2 screenshot snapshots on CI

    A single fix for shinytest2 screenshot snapshots failing on CI. Narrow and mechanical.

    View source ↗
  3. 9mo ago

    All failure messages rewritten; local_mock() now defunct

    Every expect_ function's failure message is rewritten to state what was expected, what was received and how they differ, and input types are checked consistently. R 4.1 becomes the floor, local_mock() and with_mock() become defunct because R 4.5.0 no longer permits the technique, and several long-deprecated functions are removed. The stored body is cut at 8000 characters.

    View source ↗
  4. 1y ago

    Fixes expect_no_error() and skip() outside a test

    Two bug fixes: expect_no_error(1) wrongly failing, and skip() erroring outside an active test. Small corrections.

    View source ↗
  5. 1y ago

    expect_s7_class() and new failure-testing expectations

    Adds expect_s7_class() for the new S7 object system plus expect_no_failure(), expect_no_success() and expect_snapshot_failure(). Failure messages start reporting the expected condition class — an early step toward the 3.3.0 rewrite.

    View source ↗
  6. 2y ago

    R-devel format fix and a more reliable offline check

    A maintenance release: a format-string fix for R-devel, local_mocked_bindings() extended to any object, and skip_if_offline() switched to Apple's connectivity host for reliability.

    View source ↗