mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
e52c1d16fe
* Add Travis postgresql setup. * Replace "db mocks" with a before hook that creates the same data through the HTTP API. * Reset DB and re-create all fixtures for each test. We'll need something better here. * CAVEAT: no concept of a dev vs test database. Running tests will clear data from the currently configured database.
29 lines
841 B
JavaScript
29 lines
841 B
JavaScript
var assert = require('assert'),
|
|
eventType = require('../lib/eventType'),
|
|
eventStore = require('../lib/eventStore');
|
|
|
|
describe('EventStore', function () {
|
|
describe('#create()', function () {
|
|
it('should emit event', function (done) {
|
|
eventStore.once(eventType.featureCreated, function (x) {
|
|
assert(x);
|
|
done();
|
|
}
|
|
);
|
|
|
|
var eventData = {
|
|
'name': 'mail-server.validate-email-addresses',
|
|
'enabled': false,
|
|
'strategy': 'default',
|
|
'description': 'Feature description'
|
|
};
|
|
|
|
eventStore.create({
|
|
type: eventType.featureCreated,
|
|
createdBy: 'ole',
|
|
data: eventData
|
|
});
|
|
});
|
|
});
|
|
});
|