ninjs-lodash
Version:
lodash wrapper + utils
25 lines (22 loc) • 618 B
JavaScript
/**
* Test Runner
*/
const _ = require('lodash')
const _config = require('./config')
const _debug = require('./debug')
exports = module.exports = {
test: function(api, key) {
const args = _.drop(_.toArray(arguments), 2)
const prop = api && key ? _.get(api, key) : null
if(!prop || !_.isFunction(prop)) return _.log('Invalid command')
const helper = { key: key }
args.unshift(helper)
_.log(`\n${key}\n`)
return prop.apply(null, args)
},
nstest: function(api) {
if(_.$('jav.is_local')) _.test(api, _.$('jav.ns.path'))
}
}
_.mixin(exports)