Skip to content

Commit

Permalink
test: add plugin id tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jan 17, 2024
1 parent 76f3eff commit e8befbc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ describe('Plugins', () => {
});
});

it('should error if plugin id is invalid', async () => {
await assert.rejects(
plugins.toggleActive('\t\nnodebb-plugin'),
{ message: '[[error:invalid-plugin-id]]' }
);

await assert.rejects(
plugins.toggleActive('notaplugin'),
{ message: '[[error:invalid-plugin-id]]' }
);
});

it('should upgrade plugin', function (done) {
this.timeout(0);
plugins.upgrade(pluginName, 'latest', (err, isActive) => {
Expand Down

0 comments on commit e8befbc

Please sign in to comment.