diff --git a/tests/plugins/client.PluginManager.spec.js b/tests/plugins/client.PluginManager.spec.js index b6c80ce2..0237eb9c 100644 --- a/tests/plugins/client.PluginManager.spec.js +++ b/tests/plugins/client.PluginManager.spec.js @@ -21,7 +21,6 @@ describe(`# PluginManagerClient`, () => { }); }); - await server.init(); await server.start(); }); @@ -132,12 +131,27 @@ describe(`# PluginManagerClient`, () => { }); it(`should allow to registered same plugin factory with different ids`, () => { - const client = new Server(config); client.pluginManager.register('delay-1', pluginDelayClient, {}); client.pluginManager.register('delay-2', pluginDelayClient, {}); assert.ok('should not throw'); }); + + it.only(`[FIXME #83] should throw when registering server side plugin on client side`, async () => { + client.pluginManager.register('delay-1', pluginDelayServer, {}); + + let errored = false; + try { + await client.init(); + } catch (err) { + console.log(err.message); + errored = true; + } + + if (!errored) { + assert.fail(`should have thrown`); + } + }); }); describe(`## [private] async init()`, () => { diff --git a/tests/utils/PluginDelayClient.js b/tests/utils/PluginDelayClient.js index 9751ec8d..8f11d3d5 100644 --- a/tests/utils/PluginDelayClient.js +++ b/tests/utils/PluginDelayClient.js @@ -1,7 +1,7 @@ export default function(Plugin) { return class PluginDelayClient extends Plugin { - constructor(server, id, options) { - super(server, id); + constructor(client, id, options) { + super(client, id); const defaults = { delayTime: 1000, // in ms