Skip to content

Commit

Permalink
test: add failling test for #83
Browse files Browse the repository at this point in the history
  • Loading branch information
b-ma committed Feb 19, 2024
1 parent 55d62d0 commit 4fe10bd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions tests/plugins/client.PluginManager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ describe(`# PluginManagerClient`, () => {
});
});

await server.init();
await server.start();
});

Expand Down Expand Up @@ -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()`, () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/PluginDelayClient.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4fe10bd

Please sign in to comment.