mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Improve tests
This commit is contained in:
parent
caae1d237e
commit
c68c085290
@ -629,14 +629,16 @@ describe('PluginManager', () => {
|
||||
it('should throw an error when trying to load unknown plugin', () => {
|
||||
const servicePlugins = ['ServicePluginMock3', 'ServicePluginMock1'];
|
||||
|
||||
expect(() => pluginManager.loadPlugins(servicePlugins)).to.throw(serverless.classes.Error);
|
||||
expect(() => pluginManager.loadServicePlugins(servicePlugins)).to.throw(
|
||||
serverless.classes.Error
|
||||
);
|
||||
});
|
||||
|
||||
it('should not throw error when trying to load unknown plugin with help flag', () => {
|
||||
const servicePlugins = ['ServicePluginMock3', 'ServicePluginMock1'];
|
||||
|
||||
pluginManager.setCliOptions({ help: true });
|
||||
pluginManager.loadPlugins(servicePlugins);
|
||||
pluginManager.loadServicePlugins(servicePlugins);
|
||||
|
||||
expect(() => pluginManager.loadPlugins(servicePlugins)).to.not.throw(
|
||||
serverless.classes.Error
|
||||
@ -646,7 +648,7 @@ describe('PluginManager', () => {
|
||||
it('should pass through an error when trying to load a broken plugin', () => {
|
||||
const servicePlugins = ['BrokenPluginMock'];
|
||||
|
||||
expect(() => pluginManager.loadPlugins(servicePlugins)).to.throw(brokenPluginError);
|
||||
expect(() => pluginManager.loadServicePlugins(servicePlugins)).to.throw(brokenPluginError);
|
||||
});
|
||||
|
||||
it('should not throw error when running the plugin commands and given plugins does not exist', () => {
|
||||
@ -654,7 +656,7 @@ describe('PluginManager', () => {
|
||||
const cliCommandsMock = ['plugin'];
|
||||
pluginManager.setCliCommands(cliCommandsMock);
|
||||
|
||||
expect(() => pluginManager.loadPlugins(servicePlugins)).to.not.throw(
|
||||
expect(() => pluginManager.loadServicePlugins(servicePlugins)).to.not.throw(
|
||||
serverless.classes.Error
|
||||
);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user