All files / src/testing-helpers/mock-factory mock-factory.hlpr.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 4/4
100% Lines 5/5
1 2 3 4 5 6 7 8  1x 30x 2x 28x 2x    
 
export function mockFactory(typeToMock) {
  const methods = Object.getOwnPropertyNames(typeToMock.prototype).filter(name => name !== 'constructor');
  const mock = jasmine.createSpyObj('mock' + typeToMock.name, methods);
  methods.forEach(method => { mock[method].and.callFake(() => { }); });
  return mock;
}