Skip to content

Expose files dirs seperately #1540

@OmgImAlexis

Description

@OmgImAlexis

Currently apart from passing in my own files list there doesn't seem to be any way to set the helper's directory apart from overriding the whole files array. I'd like to suggest adding a way to change each of the arrays that makes up thefiles option.

This would include defaultExcludePatterns, defaultIncludePatterns and defaultHelperPatterns . My idea would be to use an object for files which has the fieldsexcludes, includes and helpers.

ava/lib/ava-files.js

Lines 76 to 95 in 87eef84

const defaultExcludePatterns = () => [
'!**/node_modules/**',
'!**/fixtures/**',
'!**/helpers/**'
];
const defaultIncludePatterns = () => [
'test.js',
'test-*.js',
'test',
'**/__tests__',
'**/*.test.js'
];
const defaultHelperPatterns = () => [
'**/__tests__/helpers/**/*.js',
'**/__tests__/**/_*.js',
'**/test/helpers/**/*.js',
'**/test/**/_*.js'
];

The reason I'm suggesting this is I want to use __helpers__ for my helper directory as I currently have a helpers directory for a test with my helpers. To add that I'd need to replace the whole files array instead of just doing something like { files: { helpers: ['**/__helpers'] } }.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions