Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support helpers globs #2105

Closed
novemberborn opened this issue Apr 28, 2019 · 2 comments · Fixed by #2116
Closed

Support helpers globs #2105

novemberborn opened this issue Apr 28, 2019 · 2 comments · Fixed by #2116
Assignees
Milestone

Comments

@novemberborn
Copy link
Member

novemberborn commented Apr 28, 2019

#2103 removes AVA's support for finding helper files inside helpers directories. Instead we'll support this by letting users specify glob patterns to find helpers:

  • Implement helpers configuration. If specified, it must be an array containing at least one pattern
  • Any test files matched by helpers patterns must be treated as helpers
  • Watch mode must ensure that helpers are treated as sources, not tests
  • If the Babel pipeline is disabled (babel: false and compileEnhancements: false), optimize by not finding helpers: just make sure test files that match the helper patterns are not treated as tests
  • The documentation needs updating
@coreyfarrell
Copy link
Contributor

Do you plan to make the default helpers pattern be ['**/_*', '**/helpers/**']?

Also is this a good place to query about the plans for **/fixtures/**? The ability to put fixtures in test/fixtures/ is useful because nyc already ignores test/**.

@novemberborn
Copy link
Member Author

Do you plan to make the default helpers pattern be ['**/_*', '**/helpers/**']?

No. By default, the only helper files are those matched by the test file patterns that start with an underscore. Given how test file extensions can be configured, it's too confusing to have default helpers patterns. And it's been causing performance issues for users who don't use helpers but have large repositories.

Also is this a good place to query about the plans for **/fixtures/**? The ability to put fixtures in test/fixtures/ is useful because nyc already ignores test/**.

Ah I forgot to note that in the release. These files are no longer ignored, and will now be treated as test files. You'll have to exclude them in files.

novemberborn added a commit that referenced this issue May 5, 2019
@novemberborn novemberborn self-assigned this May 5, 2019
novemberborn added a commit that referenced this issue May 12, 2019
novemberborn added a commit that referenced this issue May 12, 2019
novemberborn added a commit that referenced this issue May 12, 2019
novemberborn added a commit that referenced this issue May 19, 2019
* Add test to ensure matched test files with the wrong extension are not treated as test files

* Update files and sources configuration docs

* Combine isTest() and isSource()

isSource() calls isTest(), so it's more efficient to classify whether a file is either in a single call.

* Don't rerun tests when detecting changes to files that are not tests, helpers or sources

Since ignore patterns are no longer passed to Chokidar, if a file is not
a test, helper or source, then tests do not need to be re-run.

* Support helper glob configuration

Fixes #2105.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants