exunit-code-review

Review ExUnit test code for Elixir testing best practices with Mox.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/javierhbr/random-poc --skill exunit-code-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exunit-code-review
Source: https://github.com/javierhbr/random-poc/tree/main/custom-skills/beagle-main/plugins/beagle-elixir/skills/exunit-code-review
Command: npx skills add https://github.com/javierhbr/random-poc --skill exunit-code-review

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps Elixir developers write better, more maintainable, and robust unit tests by identifying common anti-patterns and ensuring best practices are followed, especially concerning mocking and test structure.

Core Features & Use Cases

  • Pattern Identification: Detects issues with async tests, describe blocks, setup usage, and assertion styles.
  • Mocking Best Practices: Enforces correct usage of Mox for external boundaries and prevents mocking of internal code.
  • Test Adapter Guidance: Reviews the appropriate use of tools like Bypass, Swoosh, and Oban in tests.
  • Use Case: A developer submits a pull request for a new feature. This Skill is used to automatically review the associated unit tests, flagging any potential issues with how external API calls are mocked or if tests are not properly isolated.

Quick Start

Use the exunit-code-review skill to analyze the test file at /path/to/my_module_test.exs.

Frequently Asked Questions about exunit-code-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review ExUnit tests for proper Mox mocking patterns?

ExUnit test code review analyzes mocking strategies to ensure Mox is used exclusively at external boundaries. It verifies that internal modules are not mocked, maintaining test isolation and accurate behavior reflection within your _test.exs files.

What are common Elixir testing anti-patterns when setting up async tests?

Elixir testing anti-patterns include improper setup usage, flawed describe block structures, and incorrect assertion styles. Code review detects these issues within ExUnit tests to ensure maintainability and proper isolation across asynchronous test cases.

Does code review check test adapter integration for tools like Bypass and Oban?

Yes, code review checks test adapter integration for tools like Bypass, Swoosh, and Oban. It evaluates database interaction patterns and test helper configurations to verify that external API calls and background jobs are correctly handled.

Why should I not mock internal modules in Elixir unit tests?

Mocking internal modules in Elixir unit tests breaks isolation and hides design flaws. Reviewing test code enforces correct Mox usage at external boundaries, ensuring tests remain maintainable and accurately reflect intended behavior.

Can this review process analyze my test helper configurations?

Yes, the review process analyzes test helper configurations alongside your _test.exs files. It evaluates database interaction patterns and test adapter setup to ensure your testing environment is correctly configured for isolated execution.