你如何用 ava 忽略非测试文件?
how do you ignore non-test files with ava?
我可以忽略设置或支持文件夹,这样 ava 就不会尝试 运行 里面的文件吗?
我有一些用于模拟的常用实用程序文件,逻辑上应该与测试一起位于 test/
文件夹中,但我不想 运行 它们作为测试。
要忽略文件,请在文件前添加下划线 _
或感叹号 !
在 ava 的 configuration 文档中,文件要点下指出:
Files with an underscore prefix are ignored
顶部的文档也明确指出:
To ignore files, prefix the pattern with an !
(exclamation mark).
是的,请参阅 https://github.com/avajs/ava/blob/master/docs/06-configuration.md 中的 files
示例。如果您使用 !
作为模式前缀,那么任何匹配的文件都不会被视为测试文件。
我可以忽略设置或支持文件夹,这样 ava 就不会尝试 运行 里面的文件吗?
我有一些用于模拟的常用实用程序文件,逻辑上应该与测试一起位于 test/
文件夹中,但我不想 运行 它们作为测试。
要忽略文件,请在文件前添加下划线 _
或感叹号 !
在 ava 的 configuration 文档中,文件要点下指出:
Files with an underscore prefix are ignored
顶部的文档也明确指出:
To ignore files, prefix the pattern with an
!
(exclamation mark).
是的,请参阅 https://github.com/avajs/ava/blob/master/docs/06-configuration.md 中的 files
示例。如果您使用 !
作为模式前缀,那么任何匹配的文件都不会被视为测试文件。