首页 > 解决方案 > 将 ExUnit 中的测试标记为待处理

问题描述

我正在寻找一种将用 ExUnit 编写的测试标记为待处理的方法。

我知道我可以通过标签跳过测试,但是我正在寻找一种跳过测试的方法,这种方式可以高度透明地显示这些测试已被跳过,因为它们需要被实现。其他测试框架如 RSpec 或 ESpec 将这些标记为黄色并在每次运行时突出显示它们。

ExUnit中有这样的功能吗?

标签: elixirtddex-unit

解决方案


@tag :skip
test "this is my pending test"

这将导致:

 mix test
 .......................................................**

 Finished in 0.1 seconds (0.00s async, 0.1s sync)
 57 tests, 0 failures, 2 skipped

推荐阅读