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

test-agent

Package Overview
Dependencies
Maintainers
6
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-agent - npm Package Compare versions

Comparing version 0.19.4 to 0.20.0

53

lib/node/suite.js

@@ -6,3 +6,2 @@ var fsPath = require('path'),

Suite.defaults = {

@@ -18,3 +17,3 @@ testDir: 'test/',

Suite._pathJoins = [
'path',
'paths',
'libDir',

@@ -25,3 +24,9 @@ 'testDir'

Suite._joinPath = function _joinPath(key) {
this[key] = fsPath.join(fsPath.normalize(this[key]), '/');
if (Object.prototype.toString.call(this[key]) === '[object Array]') {
this[key].forEach(function(subkey, i) {
this[key][i] = fsPath.join(fsPath.normalize(this[key][i]), '/');
}, this);
} else {
this[key] = fsPath.join(fsPath.normalize(this[key]), '/');
}
};

@@ -51,3 +56,2 @@

this._definePatterns();
}

@@ -61,3 +65,2 @@

prefix = (this.strictMode) ? '^' : '';

@@ -82,4 +85,12 @@

relativePath: function relativePath(path) {
return path.replace(this.path, '');
relativePath: function relativePath(file) {
var match;
this.paths.forEach(function(path) {
if (file.indexOf(path) !== -1) {
match = path;
}
});
return file.replace(match, '');
},

@@ -95,8 +106,6 @@

result = path.
replace(this.patterns[other + 'Dir'], this[type + 'Dir']).
replace(this.patterns[other + 'Suffix'], this[type + 'Suffix']);
replace(this.patterns[other + 'Dir'], this[type + 'Dir']).
replace(this.patterns[other + 'Suffix'], this[type + 'Suffix']);
return result;

@@ -111,4 +120,4 @@ },

findFiles: function findFiles(callback) {
//always 2
var pending = 2,
// We will run joinResults() 2 times, so always multiply paths.length by 2
var pending = this.paths.length * 2,
files = [];

@@ -144,5 +153,7 @@

findTestFiles: function findTestFiles(callback) {
MatchFiles.find(this.path, {
fileFilters: [this._filterFile.bind(this, 'test')]
}, callback);
this.paths.forEach(function(path) {
MatchFiles.find(path, {
fileFilters: [this._filterFile.bind(this, 'test')]
}, callback);
}, this);
},

@@ -156,5 +167,7 @@

findLibFiles: function findLibFiles(callback) {
MatchFiles.find(this.path, {
fileFilters: [this._filterFile.bind(this, 'lib')]
}, callback);
this.paths.forEach(function(path) {
MatchFiles.find(path, {
fileFilters: [this._filterFile.bind(this, 'lib')]
}, callback);
}, this);
},

@@ -195,3 +208,1 @@

};
{
"name": "test-agent",
"version": "0.19.4",
"version": "0.20.0",
"author": "James Lal",

@@ -5,0 +5,0 @@ "description": "execute client side tests from browser report back to cli",

@@ -6,3 +6,3 @@ //all require paths must be absolute -- use __dirname

suite = new Suite({
path: __dirname,
paths: [__dirname],
testDir: 'test/test-agent',

@@ -9,0 +9,0 @@ libDir: 'lib/test-agent'

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