Created
October 21, 2015 02:49
-
-
Save reharik/1c00c4785a163262c0c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('must'); | |
| var config = require('config'); | |
| var extend = require('extend'); | |
| describe('hireTrainerTester', function() { | |
| var eventdispatcher; | |
| var handlers; | |
| var options = {}; | |
| var container; | |
| before(function () { | |
| extend(options, config.get('configs') || {}); | |
| // this is a ioc container sets everything up. the path is different | |
| // because this is in my testing folder, but the 'registery' is the same file | |
| container = require('../../registry')(options); | |
| handlers = container.getArrayOfGroup('CommandHandlers'); | |
| eventdispatcher = container.getInstanceOf('eventdispatcher'); | |
| }); | |
| context('append to stream', ()=> { | |
| it('should resolve with success', ()=> { | |
| eventdispatcher.startDispatching(handlers); | |
| }) | |
| }); | |
| }); | |
| ----------------------------------- | |
| "use strict"; | |
| var extend = require('extend'); | |
| var config = require('config'); | |
| module.exports = function(_options) { | |
| var options = {}; | |
| extend(options, config.get('configs') || {}, _options || {}); | |
| var container = require('./registry')(options); | |
| var dispatcher = container.getInstanceOf('eventdispatcher'); | |
| var handlers = container.getArrayOfGroup('CommandHandlers'); | |
| dispatcher.startDispatching(handlers); | |
| }(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment