diff --git a/lib/classes/PluginManager.test.js b/lib/classes/PluginManager.test.js index 7ee6e6fa2..3ea06eefd 100644 --- a/lib/classes/PluginManager.test.js +++ b/lib/classes/PluginManager.test.js @@ -240,6 +240,13 @@ describe('PluginManager', () => { 'event2', ], }, + spawnep: { + type: 'entrypoint', + lifecycleEvents: [ + 'event1', + 'event2', + ], + }, }, }, @@ -1070,6 +1077,21 @@ describe('PluginManager', () => { }); }); + describe('#getCommands()', () => { + it('should hide entrypoints on any level and only return commands', () => { + pluginManager.addPlugin(EntrypointPluginMock); + + const commands = pluginManager.getCommands(); + expect(commands).to.have.a.property('mycmd'); + expect(commands).to.have.a.deep.property('mycmd.commands.mysubcmd'); + expect(commands).to.have.a.deep.property('mycmd.commands.spawncmd'); + // Check for omitted entrypoints + expect(commands).to.not.have.a.property('myep'); + expect(commands).to.not.have.a.deep.property('myep.commands.mysubep'); + expect(commands).to.not.have.a.deep.property('mycmd.commands.spawnep'); + }); + }); + describe('#spawn()', () => { it('should throw an error when the given command is not available', () => { pluginManager.addPlugin(EntrypointPluginMock);