UNPKG

ninjs-lodash

Version:
25 lines (22 loc) 618 B
/** * Test Runner */ 'use strict' 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)