@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) • 552 B
JavaScript
const _ = require('lodash');
module.exports = async function testService (title, serviceName) {
context(`${serviceName} service :: ${title}:`, async function () {
it(`has ${serviceName} service`, async function (){
expect(sails.services[serviceName.toLowerCase()]).to.be.an('object');
// sails.log.debug(sails.services);
});
it(`can invoke service functions for ${serviceName}`, async function (){
let ret = await global[_.upperFirst(serviceName)][`${serviceName}Test`]();
expect(ret).to.be.ok;
});
});
}