MockingSpec.js 692 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import {
  2. bootstrapDiagram,
  3. inject
  4. } from 'test/TestHelper';
  5. import EventBus from 'lib/core/EventBus';
  6. describe('environment/Mocking', function() {
  7. var mockEventBus, bootstrapCalled;
  8. beforeEach(bootstrapDiagram(function() {
  9. mockEventBus = new EventBus();
  10. bootstrapCalled = true;
  11. return {
  12. eventBus: mockEventBus
  13. };
  14. }));
  15. afterEach(function() {
  16. bootstrapCalled = false;
  17. });
  18. it('should use spy', inject(function(eventBus) {
  19. expect(eventBus).to.equal(mockEventBus);
  20. expect(bootstrapCalled).to.equal(true);
  21. }));
  22. it('should reparse bootstrap code', inject(function(eventBus) {
  23. expect(bootstrapCalled).to.equal(true);
  24. }));
  25. });