简体   繁体   English

IEx - 运行混合“测试”任务

[英]IEx - run Mix "test" task

I get a bit tired of switching between Tmux panes so I'm trying to just work with vim and iex rather than entering mix commands into another console.我有点厌倦了在 Tmux 窗格之间切换,所以我尝试只使用vimiex ,而不是在另一个控制台中输入混合命令。

With that goal in mind, I enter the following into the iex console but my tests don't appear to execute:考虑到这个目标,我在iex控制台中输入以下内容,但我的测试似乎没有执行:

Mix.env(:test)
Mix.Task.reenable "test"
Mix.Task.run "test", []

The console output is:控制台输出为:

iex(52)>Mix.env(:test)
:ok
iex(53)>Mix.Task.reenable "test"
:ok
iex(54)>Mix.Task.run "test", []


Finished in 0.00 seconds
0 tests, 0 failures

Randomized with seed 732638
[#Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>,
 #Function<4.72894143/1 in Mix.Tasks.Test.run/1>]

Can anyone give me a pointer on how to make this work?谁能给我一个关于如何使这项工作的指针?

I had the same issue, couldn't really fix the problem but as a workaround you can use我有同样的问题,无法真正解决问题,但作为一种解决方法,您可以使用

Mix.Shell.cmd("mix test", fn _ -> nil end)

See docs查看文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM