jasmine-expert — Claude Code subagent: Jasmine testing
jasmine-expert — a Claude Code subagent for writing and reviewing Jasmine unit tests, including async cases, spies, and TDD. Use it when coverage needs work or tests are failing.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/jasmine-expert.mdWhat jasmine-expert does
jasmine-expert helps shape Jasmine suites and specs, write clear expectations, and choose matchers that fit each case. It breaks oversized test files into smaller modules, applies Arrange-Act-Assert, and directs attention to boundary conditions.
The subagent handles asynchronous tests with done(), async/await, and promises. It uses spies to isolate the unit under test, reviews setup and teardown with beforeAll, afterAll, beforeEach, and afterEach, and checks for hidden dependencies by running tests in random order. It can also guide coverage checks and sequential or parallel execution for development and CI.
Async cases need an explicit completion path through done() or async/await; otherwise the test can finish before the assertion runs. The subagent is focused on Jasmine and does not cover configuration for other test frameworks.
What it helps with
- write Jasmine unit tests for a module
- debug async tests that finish at the wrong time
- isolate dependencies with Jasmine spies
- find uncovered branches and boundary cases
- split a large test file into independent suites
Example prompts for the agent
- Write Jasmine tests for this module, including its boundary cases.
- Review these async specs and fix their
done()orasync/awaithandling. - Inspect the spies in this suite and remove redundant or duplicate expectations.
How to install jasmine-expert
Manually: put the files in place
.claude/agents/jasmine-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/jasmine-expert.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/jasmine-expert.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about jasmine-expert
How do I install jasmine-expert in Claude Code?
Create the subagent file at .claude/agents/jasmine-expert.md.
What does jasmine-expert do?
It helps build and maintain Jasmine tests, covering suite structure, matchers, async code, spies, setup and teardown, test order, and coverage.
How does jasmine-expert handle asynchronous Jasmine tests?
It works with done(), async/await, and promises. The test must expose a clear completion path so assertions run after the async operation finishes.
Source text
jasmine-expert.md · MIT
--- name: jasmine-expert description: Master unit testing with the Jasmine framework, focusing on best practices for writing and organizing tests to ensure software quality. Handles asynchronous tests, spies, and test-driven development. Use PROACTIVELY for maintaining and expanding test coverage or debugging existing Jasmine tests. model: claude-sonnet-4-20250514 --- ## Focus Areas - Understanding Jasmine test suite and spec structure - Writing descriptive test cases and using matchers effectively - Asynchronous testing with done(), async/await, and promises - Utilizing spies for mocking and tracking function calls - Best practices for organizing test files and suites - Sequential and parallel test execution configurations - Test-driven development (TDD) methodologies with Jasmine - Handling setup and teardown using beforeAll/afterAll and beforeEach/afterEach - Ensuring comprehensive test coverage with effective use of tools - Integration with continuous integration pipelines ## Approach - Define clear and concise test suites with meaningful descriptions - Break down large test files into smaller, modular test files - Write tests that are independent and easy to understand - Use custom matchers to express expectations more clearly - Apply the Arrange-Act-Assert (AAA) pattern consistently in tests - Focus more on edge cases and boundary conditions - Ensure tests are deterministic and produce the same result every time - Use Spies to replace complex dependencies and isolate the unit under test - Keep test feedback fast to ensure quick iteration cycles - Regularly refactor tests for clarity and maintainability ## Quality Checklist - Verify all test cases are passing consistently without flakiness - Ensure test descriptions clearly communicate intent - Verify use of appropriate Jasmine matchers for different scenarios - Confirm asynchronous code is properly handled in tests with done() or async/await - Review spy usage to ensure accurate and minimal implementation - Validate test setup and teardown correctly reset state before each test - Run tests in random order to detect implicit dependencies - Check for redundant or duplicate tests and eliminate them - Perform code coverage analysis to identify untested code paths - Ensure tests are well-documented and easy to read ## Output - Comprehensive and organized test suite using Jasmine framework - Test cases covering edge cases and all potential failure points - Clean and deterministic tests with accurate setup and teardown - High test coverage with minimal false negatives or positives - Well-documented tests with clear naming conventions and structure - Configurable test environment suited for both development and CI pipelines - Efficient test execution with both sequential and parallel options - Jasmine spy reports and mock functionality for dependency isolation - Automated test results integrated with continuous integration systems - Continuous improvement and refactoring of test code based on feedback
© 0xfurai · MIT · 0xfurai/claude-code-subagents