Reference tile for Themis, a Node.js and TypeScript unit test framework designed for AI coding agents. Covers unit-test authoring, Jest/Vitest migration, agent-readable failure output with repair hints, and first-class integrations for Claude Code, Cursor, and generic agents.
94%
Does it follow best practices?
Impact
99%
2.91xAverage score across 20 eval scenarios
Passed
No findings from the security scan
Use when:
themis generate)For deeper references:
npx themis init --agents (or npx themis init --claude-code for Claude Code users — this installs a CLAUDE.md, a skill at .claude/skills/themis/, and slash commands under .claude/commands/).npx themis generate <source-root> (for example src).npx themis test.npx themis test --reporter agent to get structured JSON output with failures[].cluster and failures[].repairHints. Use those to fix, then re-run with npx themis test --rerun-failed.npx themis test --update-contracts and re-run npx themis test.intent(...) for behavior and workflow validation.test(...) for low-level pure-unit checks.__themis__/tests..themis/ as framework-managed runtime artifacts.intent, test, and intent assert(...) phases) instead of Jest/Vitest primitives.describe, it, expect, jest, vi, or @jest/globals in newly authored Themis tests unless a task is explicitly scoped to migration transition work./// <reference types="@vitronai/themis/globals" />
import { slugify } from "../../src/slugify";
intent("slug pipeline handles normalization", ({ context, run, assert }) => {
context("a phrase with extra spacing", (ctx) => {
ctx.input = " Hello World ";
});
run("slugify is executed", (ctx) => {
ctx.result = slugify(String(ctx.input));
});
assert("slug output is normalized", (ctx) => {
if (ctx.result !== "hello-world") {
throw new Error(`Expected hello-world, got ${String(ctx.result)}`);
}
});
});
test("slugify handles empty input", () => {
if (slugify("") !== "") {
throw new Error("Expected empty input to stay empty");
}
});When migrating from Jest or Vitest, run this sequence:
npx themis migrate <jest|vitest>npx themis testnpx themis test --rerun-failednpx themis test --update-contractsnpx themis test and confirm the suite is stable.themis/, __themis__/reports/, and __themis__/shims/ gitignored.tests/*.cjs or tests/*.setup.* files just to shim asset/style imports.When in an edit-test-fix loop, always use --reporter agent:
npx themis test --reporter agentThe JSON output includes:
failures[].cluster — failures grouped by likely common causefailures[].repairHints — structured suggestions you can act on directlyfailures[].sourceFile, lineNumber, expected, actual — pre-parsed, no need to re-read stack tracesAfter fixing a cluster, use npx themis test --rerun-failed to confirm without running the full suite.
For Claude Code users, npx themis init --claude-code installs:
CLAUDE.md with Themis adoption rules at the repo root.claude/skills/themis/SKILL.md — auto-loads when the user asks to write, run, fix, or migrate tests.claude/commands/themis-{test,generate,migrate,fix}.md — slash commands wired to the agent reporterPostToolUse hook (scripts/claude-hook.js) that runs Themis after edits and feeds failures back into the conversationThemis is focused on deterministic JS/TS unit-test authoring and execution, not broad end-to-end orchestration.