This commit is contained in:
Barış Soner Uşaklı
2018-02-15 14:52:49 -05:00
parent a224c557c0
commit 15e9bbac92
11 changed files with 89 additions and 49 deletions

View File

@@ -70,22 +70,6 @@ describe('Plugins', function () {
});
});
it('should not crash if there is an exception in a hook', function (done) {
function filterMethod(data, callback) {
var crash;
crash.a = 5;
callback(null, data);
}
plugins.registerHook('test-plugin-crash', { hook: 'filter:test.crashHook', method: filterMethod });
plugins.fireHook('filter:test.crashHook', { foo: 1 }, function (err, data) {
assert(err);
assert.equal(err.message, 'Cannot set property \'a\' of undefined');
done();
});
});
it('should get plugin data from nbbpm', function (done) {
plugins.get('nodebb-plugin-markdown', function (err, data) {
assert.ifError(err);