Git Product home page Git Product logo

ava-files's Introduction

DEPRECATED

See avajs#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

ava-files's People

Contributors

jamestalmage avatar novemberborn avatar sindresorhus avatar sotojuan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.