Ava: Ignore underscore-prefixed directories

Created on 7 Jun 2019  路  4Comments  路  Source: avajs/ava

AVA v2 removed the default ignore for directories named fixtures, which was a good change, but the result is that I now need to have AVA config in a lot of projects to ignore it manually. Would be nice if AVA had the underscore convention for directories too. Then I could just name the directory _fixtures. AVA would ignore all files inside a underscore-prefixed directory.

This would create a nice symmetry with the existing behavior for files:

Files with an underscore prefix are ignored. - https://github.com/avajs/ava/blob/master/docs/06-configuration.md

breaking enhancement help wanted globbing

All 4 comments

This would create a nice symmetry with the existing behavior for files:

Files with an underscore prefix are ignored. - https://github.com/avajs/ava/blob/master/docs/06-configuration.md

They are treated as helper files though. But I don't think we should do that for prefixed directories.

I support allowing underscore-prefixed directories to be ignored. I don't agree that not ignoring fixtures by default was a good change (it actually wreaked a fair amount of havoc across our org and we still haven't fully updated to v2) but prefixing directories is a much easier way to go than updating config in many places.

With https://github.com/avajs/ava/pull/2323 AVA itself no longer has a concept of helpers, just files that are never test files. Once that lands, I'll try and add the checks described in this issue.

(Though the ESLint plugin helper does treat underscore-prefixed files as helpers.)

Was this page helpful?
0 / 5 - 0 ratings