test-agent
Advanced tools
Comparing version 0.26.1 to 0.26.2
@@ -34,8 +34,14 @@ var server = new (require('../websocket-server')), | ||
option('coverage-thresholds', { | ||
option('coverage-threshold', { | ||
alias: 't', | ||
desc: "Array of paths to coverage thresholds files", | ||
default: './metadata.json' | ||
desc: "Path to coverage threshold file" | ||
}). | ||
option('coverage-module-pattern', { | ||
alias: 'm', | ||
desc: 'A regular expression pattern for matching module name in appURL. \ | ||
The appURL will be http://app.gaiamobile.org:8080/...', | ||
default: /([\S]+)/ | ||
}). | ||
option('growl', { | ||
@@ -102,3 +108,4 @@ desc: "Enables growl notifications for server" | ||
use(Enhancements.BlanketConsoleReporter, { | ||
paths: argv['coverage-thresholds'].split(' ') | ||
path: argv['coverage-threshold'], | ||
pattern: argv['coverage-module-pattern'] | ||
}); | ||
@@ -105,0 +112,0 @@ |
@@ -54,7 +54,12 @@ var Client = require('../../node/client'), | ||
}). | ||
option('coverage-thresholds', { | ||
option('coverage-threshold', { | ||
alias: 't', | ||
desc: "Array of paths to coverage thresholds files", | ||
default: './metadata.json' | ||
desc: 'Path to coverage threshold file' | ||
}). | ||
option('coverage-module-pattern', { | ||
alias: 'm', | ||
desc: 'A regular expression pattern for matching module name in appURL. \ | ||
The appURL will be http://app.gaiamobile.org:8080/...', | ||
default: /([\S]+)/ | ||
}). | ||
option('server', { | ||
@@ -137,3 +142,4 @@ desc: 'Location of the websocket server to connect to.', | ||
client.use(Apps.BlanketConsoleReporter, { | ||
paths: argv['coverage-thresholds'].split(' ') | ||
path: argv['coverage-threshold'], | ||
pattern: argv['coverage-module-pattern'] | ||
}); | ||
@@ -140,0 +146,0 @@ } |
@@ -1,3 +0,2 @@ | ||
var fs = require('fs'); | ||
var pathUtils = require('path'); | ||
var path = require('path'); | ||
@@ -79,3 +78,3 @@ function BlanketConsoleReporter(options) { | ||
_printConsoleFormat: function _printConsoleFormat(coverResults) { | ||
var appName = coverResults[0].filename.match(/[A-Za-z0-9_-]+/gi)[1], | ||
var appName = coverResults[0].filename.match(this.pattern)[1], | ||
titleColor = '\u001b[1;36m', | ||
@@ -160,25 +159,8 @@ fileNameColor = '\u001b[0;37m', | ||
setupThresholds: function setupThresholds() { | ||
var paths = this.paths; | ||
this.thresholds = {}; | ||
if (paths) { | ||
paths.forEach(function(path) { | ||
var meatadata, | ||
APP_NAME = /.*\/gaia\/(?:apps|dev_apps)\/(.*)/g, | ||
appName; | ||
try { | ||
appName = APP_NAME.exec(path)[1]; | ||
meatadata = fs.readFileSync(pathUtils.join(path, 'metadata.json'), | ||
{ encoding: 'utf8' } | ||
); | ||
meatadata = JSON.parse(meatadata); | ||
this.thresholds[appName] = meatadata['coverage-threshold'] || 0; | ||
} | ||
catch (err) { | ||
this.thresholds[appName] = 0; | ||
} | ||
}, this); | ||
try { | ||
this.thresholds = require(path.join(process.cwd(), this.path)); | ||
} | ||
catch (err) { | ||
throw err; | ||
} | ||
}, | ||
@@ -185,0 +167,0 @@ |
{ | ||
"name": "test-agent", | ||
"version": "0.26.1", | ||
"version": "0.26.2", | ||
"author": "James Lal", | ||
@@ -5,0 +5,0 @@ "description": "execute client side tests from browser report back to cli", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
252112
7720