| * Created by teone on 4/18/16. |
| /* eslint-disable angular/ng_window_service*/ |
| // TODO write tests for log |
| // NODE Actually the code is working, the tests are not. |
| xdescribe('The xos.helper module', function(){ |
| mockLog = jasmine.createSpyObj('logMock', ['info']); |
| angular.mock.module('xos.helpers', function($injector, $provide) { |
| // console.log('$injector',$injector.get('logDecorator')); |
| $provide.value('$log', mockLog); |
| // $provide.decorator('$log', $injector.get('logDecorator')); |
| beforeEach(inject(($log, $window) => { |
| describe('The log decorator', () => { |
| it('should not print anything', inject(($log) => { |
| expect(mockLog.info).not.toHaveBeenCalled(); |
| describe('if logging is enabled', () => { |
| window.location.href += '?debug=true' |
| it('should should log', () => { |
| console.log(log.info.logs); |