Power Assert for Elixir: enhances ExUnit test output by showing evaluation results of each expression in assertions.
Power Assert is an Elixir library that enhances ExUnit's assertion output by showing the evaluation results of each sub-expression within test assertions. It helps developers understand exactly why a test failed by revealing intermediate values without requiring changes to test logic. This makes debugging complex assertions significantly easier.
Elixir developers using ExUnit for testing who want better debugging insights from test failures, particularly those working with complex assertions or nested expressions.
Developers choose Power Assert because it provides dramatically better test failure diagnostics with zero code changes—simply replace one import statement. Unlike traditional assertion libraries, it shows the complete evaluation chain, making it ideal for debugging complex logical expressions.
Power Assert in Elixir. Shows evaluation results each expression.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Displays intermediate evaluation results for each sub-expression, as shown in the demo GIF where variables and pipeline steps are revealed, making test failures intuitive to diagnose.
Simply replace 'use ExUnit.Case' with 'use PowerAssert' in test modules, requiring no changes to assertion logic or test structure, as demonstrated in the installation guide.
Maintains full compatibility with ExUnit's API and workflow, allowing it to work with existing test suites and frameworks like ExSpec without modification.
Can be appended to other testing frameworks that depend on ExUnit, such as ExSpec, with a single line addition, ensuring flexibility across different testing setups.
The README admits unsupported features like match expressions, fn expressions, sigils, and case expressions, which can break or require refactoring of tests using these constructs.
Warns that 'many macros maybe caught error...', making it unreliable for test suites with heavy metaprogramming or custom macros, potentially leading to cryptic failures.
At version 0.2.0, it may lack the stability and comprehensive feature set of more established testing libraries, with potential for bugs or incomplete support in edge cases.