Joined May 2017
·

m_a_c100

Full Stack Developer at Wealth Tech
·
Mumbai India
·
·

Here's my code -
describe('InstrumentPipe', () => {
describe('InstrumentService', function () {
var createService;
// shows compiler error on "inject(function"
beforeEach(inject(function () {
var $injector = angular.injector(['../services/InstrumentService'])
// shows compiler error on "angular.injector"

  createService = function () {
    return $injector.get('InstrumentService');
  }
}));

it('create an instance', () => {
  const pipe = new InstrumentPipe(createService);
  expect(pipe).toBeTruthy();
});

});

please mention the imports which are required ...as i tried injecting a service in a unit test of a pipe object creation, although your code works but I am unable to figure out the imports you have used.

Achievements
1 Karma
0 Total ProTip Views
Interests & Skills