mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
50b56fd7a1
There is an example in eventRepositorySpec on how to listen on events.
23 lines
734 B
JavaScript
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'
|
|
});
|
|
});
|
|
});
|
|
});
|