mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
closes #6311
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user