how do you ignore non-test files with ava?
Asked Answered
A

2

5

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

I have some common 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.

Absorption answered 5/7, 2019 at 12:32 Comment(0)
A
3

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).

Absorption answered 5/7, 2019 at 12:40 Comment(0)
B
4

Yes, see the files examples in https://github.com/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.

Barbur answered 7/7, 2019 at 13:26 Comment(0)
A
3

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).

Absorption answered 5/7, 2019 at 12:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.