- Home
- Skills
- Fortiumpartners
- Ai Mesh
- Exunit Test
exunit-test_skill
- JavaScript
9
GitHub Stars
3
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill fortiumpartners/ai-mesh --skill exunit-test- generate-test.exs2.3 KB
- run-test.exs3.9 KB
- SKILL.md5.0 KB
Overview
This skill provides ExUnit test generation and execution for Elixir projects, with support for describe blocks, setup/setup_all callbacks, and async testing. It creates _test.exs files from source modules or bug descriptions and runs Mix test to return structured JSON results. The skill is designed to integrate into debugging or CI workflows to reproduce, validate, and verify fixes.
How this skill works
Generate commands create test files from templates using the source file, module name, and a short description; options allow toggling async and picking output paths. Test execution runs Mix test on a specified test file and returns JSON with pass/fail counts, duration, and detailed failure records. The tool respects ExUnit conventions like describe blocks, setup callbacks, and async flags so generated tests fit idiomatic Elixir projects.
When to use it
- Reproducing a bug by generating a focused failing test from a bug report
- Adding unit tests for a module from an existing source file
- Running a single test file during development or CI to get machine-readable results
- Validating a reported fix by re-running a previously failing test
- Integrating with a debugger or automation pipeline to verify behavior changes
Best practices
- Mirror the source file path under test/ and use _test.exs suffix to follow conventions
- Use describe blocks to group related tests and keep each test small and deterministic
- Prefer setup/setup_all to share fixtures and avoid duplicated setup code
- Enable async: true only for tests that do not touch shared state or external resources
- Run generated tests locally first and include test_helper.exs to load ExUnit configuration
Example use cases
- Generate a failing test for a reported division-by-zero bug and run it to confirm failure
- Create unit tests for a new module with setup providing common fixtures across tests
- Execute a single test file in CI with JSON output to feed into a dashboard
- Produce async test files for fast, parallelizable test suites
- Automate a reproduce-validate-fix loop with a debugger: generate test, run, fix, rerun
FAQ
Elixir and Mix must be installed (Elixir 1.12+ recommended); ExUnit is built into Elixir.
How does async testing affect generated tests?
Async tests are marked with use ExUnit.Case, async: true and should not rely on shared state or external resources to avoid flaky results.