如何手动指定要在自动测试中运行的测试文件?
当非测试文件更新时,如何手动指定应运行哪些测试/单元测试文件?
How do I manually specify which test/unit test files should be run when a non-test file gets updated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在
~/.autotest
或/.autotest
文件中创建自定义映射,如下所示:这与
spec/lib/foo
中的规范匹配code> 目录到lib/foo
文件,因此一旦lib/foo
下的文件被更改,这些规范就会运行。我想您可以对test
目录执行相同的操作。You can create custom mappings in
~/.autotest
or<project_path>/.autotest
file like this:This matches specs in
spec/lib/foo
directory tolib/foo
files, so these specs will run once files underlib/foo
are being changed. I guess you can do the same withtest
directory.重新定义 Autotest#test_files_for(filename) 以返回测试文件名的字符串数组。
一些教程引用了
tests_for_file
,但这是该方法的旧名称:它是 在 ZenTest 3.9.0 中更改为test_files_for
。同样,重新定义
tests_files_for
也无济于事。Redefine
Autotest#test_files_for(filename)
to return an array of strings of the test file names.Some tutorials refer to
tests_for_file
, but that was the old name of the method: it was changed in ZenTest 3.9.0 totest_files_for
.Similarly, redefining
tests_files_for
won't help.