Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ava-files

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ava-files

File resolution for AVA

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
increased by127.89%
Maintainers
5
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 09 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc