@vph-garage/sails-interfuser
Version:
Automizing injection of your [custom Sails.JS] hook's MVC logics (models, controllers, helpers, services, config, policies, views, and assets) from the hook's directory [presuming default structure], or specified directories, into the end-product, Sails.J
17 lines (13 loc) • 632 B
JavaScript
const _ = require('lodash');
module.exports = async function testAction (title, actionName) {
// the sails._actions dictionary uses lowercase of actions definitions, so prepare for that
let actionname = actionName.toLowerCase();
let action = `${actionname}action/test-action`;
context(`${actionName} action :: ${title}:`, async function () {
it(`has injected action ${actionName}Action/test-action`, async function (){
// sails.log.debug('action: ', action);
expect(sails._actions[action]).to.be.a('function');
// sails.log.debug(sails._actions);
});
});
}