senecajs / seneca

A microservices toolkit for Node.js.
http://senecajs.org
MIT License
3.95k stars 314 forks source link

explicit tests for these operators #831

Closed github-actions[bot] closed 4 years ago

github-actions[bot] commented 4 years ago

explicit tests for these operators

https://github.com/senecajs/seneca/blob/6d7a79515c7272184785478495f3958ed872c827/lib/plugin.js#L562

                }
            }
            plugin_done();
            return {
                op: 'seneca_complete',
                out: {
                    plugin: {
                        loading: false
                    }
                }
            };
        }
    };
}
function make_intern() {
    return {
        // TODO: explicit tests for these operators
        op: {
            seneca_plugin: (tr, ctx, data) => {
                nua_1.default(data, tr.out.merge, { preserve: true });
                ctx.seneca.private$.plugins[data.plugin.fullname] = tr.out.plugin;
                return { stop: false };
            },
            seneca_export: (tr, ctx, data) => {
                Object.assign(data.exports, tr.out.exports);
                Object.assign(ctx.seneca.private$.exports, tr.out.exports);
                return { stop: false };
            },
            seneca_options: (tr, ctx, data) => {
                nua_1.default(data.plugin, tr.out.plugin, { preserve: true });
                let plugin_fullname = data.plugin.fullname;
                let plugin_options = data.plugin.options;
                let plugin_options_update = { plugin: {} };
                plugin_options_update.plugin[plugin_fullname] = plugin_options;
                ctx.seneca.options(plugin_options_update);
                return { stop: false };
            },
            seneca_complete: (tr, _ctx, data) => {
                nua_1.default(data.plugin, tr.out.plugin, { preserve: true });
                if (data.prepare.err) {
                    data.delegate.die(data.delegate.error(data.prepare.err, data.plugin.err_code, data.plugin));
                }
                return { stop: true };
            },
        },
        define_plugin: function (delegate, plugin, options) {
            // legacy plugins
            if (plugin.define.length > 1) {
github-actions[bot] commented 4 years ago

Closed in 6d7a79515c7272184785478495f3958ed872c827

github-actions[bot] commented 4 years ago

Closed in 6d7a79515c7272184785478495f3958ed872c827