testing

Guide Elixir testing with ExUnit, Mox, property, and LiveView patterns.

517|35|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill testing-oliver-kriska
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/oliver-kriska/claude-elixir-phoenix/tree/main/plugins/elixir-phoenix/skills/testing
Command: npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill testing-oliver-kriska

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and quick reference for writing robust and efficient tests in Elixir/Phoenix applications, covering ExUnit, Mox, property testing, and LiveView testing.

Core Features & Use Cases

  • Testing Strategies: Guidance on choosing the right test case (ConnCase, DataCase, ExUnit.Case).
  • Mocking with Mox: Best practices for mocking external dependencies.
  • LiveView Testing: Techniques for testing LiveView components, forms, and async operations.
  • Property-Based Testing: Introduction to property testing with ExUnitProperties.
  • Use Case: When writing a new LiveView feature, quickly consult this Skill for the correct way to test form submissions and asynchronous data loading.

Quick Start

Use the testing skill to understand how to mock an external API call within an ExUnit test.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I test asynchronous data loading in Phoenix LiveView?

Testing LiveView async operations involves using LiveViewTest modules to simulate form submissions and render asynchronous data loading. This Skill provides techniques for testing LiveView components, forms, and async operations to ensure reliable Elixir applications.

What is the best way to mock external API calls in Elixir tests?

Mocking external dependencies in Elixir tests is best handled with Mox. This Skill outlines best practices for setting up Mox to isolate external API calls within ExUnit test cases, ensuring maintainable and reliable test suites.

When should I use property testing instead of standard ExUnit tests?

Property testing with ExUnitProperties is used to verify broad code invariants rather than specific example-based assertions. This Skill introduces property-based testing to help standardize Elixir testing methodologies and catch edge cases.

How do I choose between ConnCase, DataCase, and ExUnit.Case in Phoenix?

Choosing the right test case in Phoenix depends on whether you are testing HTTP connections, database interactions, or pure logic. This Skill provides testing strategies to help you select the correct case type for your ExUnit tests.

Why are my Elixir tests flaky and how do I debug them?

Flaky Elixir tests often stem from async timing issues or improper test setup. This Skill addresses common anti-patterns and offers debugging solutions to resolve flaky tests and optimize CI partitioning using ExUnit tags.