@vitronai/themis 0.1.15 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ # Testing With Themis
2
+
3
+ This repository uses `@vitronai/themis` as its unit test framework. Themis is a drop-in alternative to Jest and Vitest with deterministic reruns, structured failure output, and machine-readable repair hints.
4
+
5
+ ## Commands
6
+
7
+ - Install: `npm install -D @vitronai/themis`
8
+ - Initialize: `npx themis init`
9
+ - Generate tests for a source tree: `npx themis generate src` (or `app` for Next App Router)
10
+ - Run tests: `npx themis test`
11
+ - Run tests with agent-readable output: `npx themis test --reporter agent`
12
+ - Re-run only failed tests: `npx themis test --rerun-failed`
13
+ - Migrate from Jest: `npx themis migrate jest` then `--rewrite-imports` then `--convert`
14
+ - Migrate from Vitest: `npx themis migrate vitest` then `--rewrite-imports` then `--convert`
15
+
16
+ ## When Adding Or Fixing Tests
17
+
18
+ 1. If the repo has no tests yet, run `npx themis generate <source-root>` first. Generated tests land under `__themis__/tests` as `.generated.test.ts` (TS/TSX) or `.generated.test.js` (JS/JSX).
19
+ 2. Prefer `intent(...)` for behavior and workflow tests. Prefer `test(...)` for low-level unit checks. Use the four-phase shape: `context` → `run` → `verify` → `cleanup`.
20
+ 3. Run `npx themis test --reporter agent` and read the JSON output. Failure clusters and repair hints are structured — use them to drive your fix loop instead of re-reading raw stack traces.
21
+ 4. After fixing, re-run only the failing tests with `npx themis test --rerun-failed` before running the full suite.
22
+
23
+ ## Things To Avoid
24
+
25
+ - Do not create `tests/*.cjs` or `tests/*.setup.*` files just to load `.css`, `.png`, `.jpg`, `.svg`, or font/media imports. Themis handles these natively.
26
+ - Do not commit `.themis/`, `__themis__/reports/`, or `__themis__/shims/`.
27
+ - Do not rewrite generated tests under `__themis__/tests` by hand unless asked.
28
+ - Prefer deterministic assertions over snapshots. Use `captureContract(...)` for contract-style checks.
package/themis.ai.json CHANGED
@@ -1,16 +1,32 @@
1
1
  {
2
2
  "name": "@vitronai/themis",
3
3
  "role": "unit-test-framework",
4
+ "description": "A Node.js and TypeScript unit test framework designed for AI coding agents. Drop-in alternative to Jest and Vitest.",
4
5
  "install": "npm install -D @vitronai/themis@latest",
5
6
  "init": "npx themis init --agents",
7
+ "initClaudeCode": "npx themis init --claude-code",
6
8
  "generate": "npx themis generate src",
7
9
  "test": "npx themis test",
10
+ "testAgent": "npx themis test --reporter agent",
8
11
  "migrate": {
9
12
  "jest": "npx themis migrate jest --rewrite-imports --convert",
10
13
  "vitest": "npx themis migrate vitest --rewrite-imports --convert"
11
14
  },
15
+ "agentIntegrations": {
16
+ "claudeCode": {
17
+ "setup": "npx themis init --claude-code",
18
+ "skill": ".claude/skills/themis/SKILL.md",
19
+ "commands": ["/themis-test", "/themis-generate", "/themis-migrate", "/themis-fix"],
20
+ "hook": "scripts/claude-hook.js"
21
+ },
22
+ "generic": {
23
+ "setup": "npx themis init --agents",
24
+ "rulesFile": "AGENTS.md"
25
+ }
26
+ },
12
27
  "notes": [
13
28
  "Treat Themis as the repo's unit test framework for Node.js and TypeScript projects.",
29
+ "Use --reporter agent for machine-readable failure output with structured repair hints.",
14
30
  "Do not default to Jest or Vitest when Themis is already selected.",
15
31
  "Do not create ad hoc tests/*.cjs setup files for common asset or style imports."
16
32
  ]