UNPKG

@kitmi/jacaranda

Version:

JavaScript application framework

34 lines (27 loc) 866 B
import Feature from '../Feature'; import HttpClient from '../helpers/HttpClient'; export default { /** * This feature is loaded at init stage * @member {string} */ stage: Feature.SERVICE, /** * This feature can be grouped by serviceGroup * @member {boolean} */ groupable: true, packages: ['supertest'], /** * Load the feature * @param {App} app - The cli app module object * @param {object} settings - Settings of rest clients * @returns {Promise.<*>} */ load_: async function (app, settings, name) { const supertest = await app.tryRequire_('supertest', true); const { supertest: adapter } = await app.tryRequire_('@kitmi/adapters', false); let client = new HttpClient(adapter(supertest), settings); app.registerService(name, client); }, };