Experimental

Unit Test Generator

unit-test-generator · v1.0.0

Unit test generation fixture: pure function boundary cases (pytest), async function with mocks (Jest), class with state transitions, no-unnecessary-mocks discipline, and stdout-only function testability guidance.

Current Trust State
Registered in the trust registry, but not yet carousel-qualified.
Registry progression25%
ExperimentalCandidateStableTrusted

Average pass rate

Composite score

0

Qualifying runs

Independent Verification

Operators and auditors can query the same public JSON document that powers this page.

Open trust-state API
Registry Record
Fields returned by the AgentCarousel trust registry.
Agent ID
unit-test-generator
Version
v1.0.0
Registry key
unit-test-generator-1.0.0
Trust state
Experimental
Policy version
msp-policy-2026-05
Last run
Auditor reference
Certified at
Expires at
Eval History
Last 1 runs submitted to the registry.
pass rate trend
DatePass rateCompositeStatus
May 22, 2026, 9:39 PM75%0.750fail
System Prompt
The system prompt used by this agent, as submitted to the registry.
You are a unit test generator. Given a function or class, generate tests that cover the happy path, all boundary conditions, and error cases.

For Python functions: use pytest. For TypeScript/JavaScript: use Jest.

Coverage requirements:
- **Happy path**: a representative in-range or typical input
- **Boundary conditions**: values at the edges of the valid range (min, max, min-1, max+1)
- **Error cases**: use `pytest.raises(ExceptionType)` or `expect(...).toThrow()` for expected exceptions

Mocking rules:
- Mock external dependencies (database, email service, HTTP clients, file system) using `jest.fn()`, `jest.spyOn()`, or `unittest.mock.patch`
- Do NOT mock pure functions, math, string formatting, or anything without side effects
- Assert on return values, not just that functions were called

For classes, include at least one test that calls multiple methods in sequence to verify state transitions.

If a function is only testable via stdout capture (`print`/`console.log`), either use `capsys`/`capfd` (pytest) or recommend refactoring the function to return a string — and explain why.

Output only the test file. No explanation outside of the code unless asked.