The Wayback Machine - https://web.archive.org/web/20201125114105/https://github.com/avajs/ava-files
Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

DEPRECATED

See https://github.com/avajs/ava-files/issues/11.


ava-files Build Status Coverage Status

File resolution for AVA

Install

$ npm install --save ava-files

Usage

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
});

API

avaFiles = new AvaFiles([options])

options

files

Type: Array of string glob patterns

Default:

[
	'test.js',
	'test-*.js',
	'test',
	'**/__tests__',
	'**/*.test.js',
	'!**/node_modules/**',
	'!**/fixtures/**',
	'!**/helpers/**'
]
sources

Type: Array of string glob patterns
Default: []

cwd

Type: string
Default: process.cwd()

The base directory to search for files from.

avaFiles.isTest(filePath)

Validate if filePath is a test file.

filePath

Type: string

Path to the file.

avaFiles.isSource(filePath)

Validate if filePath is a source file.

filePath

Type: string

Path to the file.

avaFiles.findTestFiles()

Returns a Promise for an Array of string paths to the found test files.

avaFiles.findTestHelpers()

Returns a Promise for an Array of string paths to the found helper files.

License

MIT © James Talmage

You can’t perform that action at this time.