1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/unleash-server/test/eventRepositorySpec.js
svelovla 50b56fd7a1 #18 eventRepository can now emit events
There is an example in eventRepositorySpec on how to listen on events.
2014-10-22 15:35:43 +02:00

23 lines
734 B
JavaScript

var assert = require('assert');
var events = require('../lib/events');
var EventRepository = require('../lib/eventRepository');
var eventRepository = new EventRepository();
describe('EventRepository', function () {
describe('#create()', function () {
it('should emit event', function (done) {
eventRepository.on(events.featureCreated, function (x) {
assert(x);
done();
}
);
eventRepository.create({
'name': 'mail-server.validate-email-addresses',
'enabled': false,
'strategy': 'default',
'description': 'Feature description'
});
});
});
});