title: Jasmine spy on base class protected property
body: <p>I have a scenario to spy the protected property from the base class. </p>
  
  <pre><code>export class BaseClass {
      protected property1: string;
  }
  
  export class InheritedClass extends BaseClass, OnInit {
  
     ngOnInit() {
          this.populateProperties();
     }
  
     populateProperties() {
         this.property1 = "test";
     } 
  }
  </code></pre>
  
  <p>I am trying to write the unit test for this but is returning <code>property1</code> not found. What could be the issue?</p>
  
  <pre><code>describe('populateProperties', () =&gt; {
      it('should assign the properties values', () =&gt; {
        // arrange
        const spy = spyOnProperty((component as any), 'property1');
  
        // act
        component.populateProperties();
  
        // assert
        expect(spy).toBeDefined();
  
      });
    });
  </code></pre>