master
 1import * as commands from '../../services/commands';
 2import Api from '../../infrastructure/api';
 3import Registry from '../../infrastructure/registry';
 4import WireUpComponentsInto from '../wire-up-components-into';
 5
 6describe("WireUpComponentsInto", () => {
 7  let subject = null;
 8  let registry = null;
 9
10  beforeEach(() => {
11    registry = new Registry();
12    subject = new WireUpComponentsInto(registry);
13  });
14
15  describe("#run", () => {
16    beforeEach(() => {
17      subject.run()
18    });
19
20    it ("registers each command", function() {
21      results = registry.resolveAll('subscriber');
22      expect(results.length).toEqual(5);
23    });
24
25    it ("can build the api", function() {
26      result = registry.resolve('api');
27      expect(result).toBeInstanceOf(Api);
28    });
29  });
30})