我为Elixir项目编写了一些测试,并将它们放在test/
目录中。现在我运行mix test
,我得到:
$ mix test
Test patterns did not match any file:
那就是它,那之后什么也没有。 我是否必须手动设置测试路径?快速Google搜索没有透露任何内容。
这就是我所有测试的结果:
# project_dir/test/my_app/some_module.exs
defmodule MyApp.SomeModule.Test do
use ExUnit.Case
doctest MyApp.SomeModule
test "method 1" do
assert MyApp.SomeModule.method_1_works?
end
test "method 2" do
assert MyApp.SomeModule.method_2_works?
end
end
答案 0 :(得分:5)
所有测试都应该以{{1}} 结束。将我的测试从_test.exs
重命名为some_module.exs
修复它,现在它可以正常工作。
来自some_module_test.exs
:
此任务启动当前应用程序,加载
$ mix help test
然后要求所有匹配的文件test/test_helper.exs
模式并行。
我仍然想知道是否可以手动配置测试路径(即使“测试”并没有结束) 的