New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

41

index.js

@@ -30,2 +30,11 @@ 'use strict';

function defaultHelperPatterns() {
return [
'**/__tests__/helpers/**/*.js',
'**/__tests__/**/_*.js',
'**/test/helpers/**/*.js',
'**/test/**/_*.js'
];
}
function AvaFiles(options) {

@@ -38,5 +47,13 @@ if (!(this instanceof AvaFiles)) {

var files = options.files;
var files = (options.files || []).map(function (file) {
// `./` should be removed from the beginning of patterns because
// otherwise they won't match change events from Chokidar
if (file.slice(0, 2) === './') {
return file.slice(2);
}
if (!files || !files.length) {
return file;
});
if (!files.length) {
files = defaultIncludePatterns();

@@ -63,2 +80,13 @@ }

AvaFiles.prototype.findTestHelpers = function () {
return handlePaths(defaultHelperPatterns(), ['!**/node_modules/**'], {
cwd: this.cwd,
includeUnderscoredFiles: true,
cache: Object.create(null),
statCache: Object.create(null),
realpathCache: Object.create(null),
symlinks: Object.create(null)
});
};
function getDefaultIgnorePatterns() {

@@ -263,4 +291,11 @@ return defaultIgnore.map(function (dir) {

.filter(function (file) {
return file && path.extname(file) === '.js' && path.basename(file)[0] !== '_';
return file && path.extname(file) === '.js';
})
.filter(function (file) {
if (path.basename(file)[0] === '_' && globOptions.includeUnderscoredFiles !== true) {
return false;
}
return true;
})
.map(function (file) {

@@ -267,0 +302,0 @@ return path.resolve(file);

2

package.json
{
"name": "ava-files",
"version": "0.2.0",
"version": "1.0.0",
"description": "File resolution for AVA",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -33,2 +33,6 @@ # ava-files [![Build Status](https://travis-ci.org/avajs/ava-files.svg?branch=master)](https://travis-ci.org/avajs/ava-files) [![Coverage Status](https://coveralls.io/repos/github/avajs/ava-files/badge.svg?branch=master)](https://coveralls.io/github/avajs/ava-files?branch=master)

});
avaFiles.findTestHelpers().then(files => {
// files is an array of found test helpers
});
```

@@ -98,5 +102,9 @@

### avaFiles.findTestHelpers()
Returns a `Promise` for an `Array` of `string` paths to the found helper files.
## License
MIT © [James Talmage](https://github.com/avajs)
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