title: How to fix 'TypeError: this.form.get is not a function' in karma test runner
body: <p>I am using <code>formbuilder.group</code> to create reactive form with the formcontrol <code>name</code> in <code>ngOnInit()</code> and made a get function for name, when I run <code>ng test</code> I get error as below</p>
  <ul>
  <li>I have created the test case for my component using Simon Test extension</li>
  <li>I tried importing <code>ReactiveFormsModule, CommonModule</code> in spec.ts</li>
  <li>I tried changing <code>form.get('name')</code> to <code>form.controls.name</code></li>
  </ul>
  <h3>Error in karma-test runner</h3>
  <pre><code>Test1Component ngOnInit makes expected calls
  TypeError: this.form.get is not a function
  TypeError: this.form.get is not a function
      at Test1Component.get [as name] (http://localhost:9877/_karma_webpack_/webpack:/src/app/test1/test1.component.ts:27:22)
      at Test1Component../src/app/test1/test1.component.ts.Test1Component.printVal (http://localhost:9877/_karma_webpack_/webpack:/src/app/test1/test1.component.ts:23:22)
      at Test1Component.SpyStrategy.exec (http://localhost:9877/absoluteC:/Users/ratnsing/Desktop/Ratnesh/Angular7/Xv1/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?0b1eaf7a13cae32191eadea482cfc96ae41fc22b:5083:19)
      at Test1Component.spy (http://localhost:9877/absoluteC:/Users/ratnsing/Desktop/Ratnesh/Angular7/Xv1/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?0b1eaf7a13cae32191eadea482cfc96ae41fc22b:4873:44)
      at Test1Component.&lt;anonymous&gt; (http://localhost:9877/absoluteC:/Users/ratnsing/Desktop/Ratnesh/Angular7/Xv1/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?0b1eaf7a13cae32191eadea482cfc96ae41fc22b:4849:20)
      at Test1Component.printVal (http://localhost:9877/absoluteC:/Users/ratnsing/Desktop/Ratnesh/Angular7/Xv1/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?0b1eaf7a13cae32191eadea482cfc96ae41fc22b:4890:50)
      at Test1Component../src/app/test1/test1.component.ts.Test1Component.ngOnInit (http://localhost:9877/_karma_webpack_/webpack:/src/app/test1/test1.component.ts:19:10)
      at UserContext.&lt;anonymous&gt; (http://localhost:9877/_karma_webpack_/webpack:/src/app/test1/test1.component.spec.ts:28:17)
      at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9877/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone.js:391:1)
      at ProxyZoneSpec.push../node_modules/zone.js/dist/zone-testing.js.ProxyZoneSpec.onInvoke (http://localhost:9877/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone-testing.js:289:1)
  
  </code></pre>
  <h3>test1.component.ts</h3>
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { FormGroup, FormBuilder } from '@angular/forms';
  
  @Component({
    selector: 'app-test1',
    templateUrl: './test1.component.html',
    styleUrls: ['./test1.component.css']
  })
  export class Test1Component implements OnInit {
  
    form: FormGroup;
  
    constructor(private formBuilder: FormBuilder) { }
  
    ngOnInit() {
      this.form = this.formBuilder.group({
        name: ['Init Value']
      });
      this.printval();
    }
  
    printVal() {
      console.log(this.name);
    }
  
    get name() {
      return this.form.get('name');
    }
  }
  </code></pre>
  <h3>test1.component.spec.ts</h3>
  <pre><code>import { ComponentFixture, TestBed } from '@angular/core/testing';
  import { NO_ERRORS_SCHEMA } from '@angular/core';
  import { FormBuilder } from '@angular/forms';
  import { Test1Component } from './test1.component';
  describe('Test1Component', () =&gt; {
    let component: Test1Component;
    let fixture: ComponentFixture&lt;Test1Component&gt;;
    beforeEach(() =&gt; {
      const formBuilderStub = { group: object1 =&gt; ({}) };
      TestBed.configureTestingModule({
        schemas: [NO_ERRORS_SCHEMA],
        declarations: [Test1Component],
        providers: [{ provide: FormBuilder, useValue: formBuilderStub }]
      });
      fixture = TestBed.createComponent(Test1Component);
      component = fixture.componentInstance;
    });
    it('can load instance', () =&gt; {
      expect(component).toBeTruthy();
    });
    describe('ngOnInit', () =&gt; {
      it('makes expected calls', () =&gt; {
        const formBuilderStub: FormBuilder = fixture.debugElement.injector.get(
          FormBuilder
        );
        spyOn(component, 'printVal').and.callThrough();
        spyOn(formBuilderStub, 'group').and.callThrough();
        component.ngOnInit();
        expect(component.printVal).toHaveBeenCalled();
        expect(formBuilderStub.group).toHaveBeenCalled();
      });
    });
  });
  </code></pre>
  <p>I found that <code>.get</code> is a part of AbstractControl property,
  expecting al the test cases to pass...</p>