我的Elixir应用程序中有几个文件,我希望从测试覆盖率报告中排除它们。我现在没有使用任何花哨的复盖工具;(尽管我并不排除使用这些工具的可能性),我现在只是在使用mix test --cover。
我如何告诉覆盖率分析工具,给定的文件不应该包含在覆盖率分析中?
发布于 2021-07-14 21:48:50
Elixir v1.11添加了:ignore_modules。参见https://hexdocs.pm/mix/1.11.0/Mix.Tasks.Test.html#module-coverage。
下面是一个例子:
def project do
[
# ...
test_coverage: [ignore_modules: [Exclude.This, Exclude.That]]
]
end发布于 2019-05-08 04:52:57
目前还不能直接在Elixir中这样做。据我所知,有两个库可以排除特定模块。
Coverex https://github.com/alfert/coverex
Excoveralls https://github.com/parroty/excoveralls。
看看你是否喜欢它们。有关此主题的更多信息,请查看以下链接。
https://elixirforum.com/t/code-coverage-tools-for-elixir/18102/2
https://stackoverflow.com/questions/56027972
复制相似问题