最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how do you ignore non-test files with ava? - Stack Overflow

programmeradmin3浏览0评论

Can I ignore a setup or support folder so that ava doesn't try to run the files inside?

I have some mon utility files used for mocking that should logically live inside the test/ folder alongside tests but I don't want to run them as tests.

Can I ignore a setup or support folder so that ava doesn't try to run the files inside?

I have some mon utility files used for mocking that should logically live inside the test/ folder alongside tests but I don't want to run them as tests.

Share Improve this question edited Jul 15, 2020 at 10:10 Cookie asked Jul 5, 2019 at 12:32 CookieCookie 5958 silver badges24 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Yes, see the files examples in https://github./avajs/ava/blob/master/docs/06-configuration.md. If you prefix a pattern with ! then any matching files will not be considered to be test files.

To ignore files prefix them with an underscore _ or an exclamation mark !


In ava's documentation for configuration under the files bulletpoint it states:

Files with an underscore prefix are ignored

And the documentation at the top also explicitly states:

To ignore files, prefix the pattern with an ! (exclamation mark).

发布评论

评论列表(0)

  1. 暂无评论