npm install ava-files> File resolution for AVA
```
$ npm install --save ava-files
`js
const AvaFiles = require('ava-files');
const avaFiles = new AvaFiles({
cwd: '/path/to/cwd',
files: ['/glob/patterns/'],
sources: ['/glob/patterns/']
});
avaFiles.isTest(filePath);
//=> true or false
avaFiles.isSource(filePath);
//=> true or false
avaFiles.findTestFiles().then(files => {
// files is an array of found test files
});
avaFiles.findTestHelpers().then(files => {
// files is an array of found test helpers
});
`
#### options
##### files
Type: Array of string glob patterns
Default:
`js`
[
'test.js',
'test-*.js',
'test',
'**/__tests__',
'*/.test.js',
'!/node_modules/',
'!/fixtures/',
'!/helpers/'
]
##### sources
Type: Array of string glob patterns[]
Default:
##### cwd
Type: stringprocess.cwd()
Default:
The base directory to search for files from.
Validate if filePath is a test file.
#### filePath
Type: string
Path to the file.
Validate if filePath is a source file.
#### filePath
Type: string
Path to the file.
Returns a Promise for an Array of string paths to the found test files.
Returns a Promise for an Array of string` paths to the found helper files.
MIT © James Talmage