title: Angular 2 Services Unit Testing with DarkSkyApi call
body: <p>I hope you can help. I search in the whole internet for answer to my questions. I new in programming with Angular 2 and all answers i find are to crypticle to me.</p>
  
  <p>so thats my question. I will test a service in angular 2 with karma. And have the DarkskyApi in Use at the Service:</p>
  
  <pre><code>//imports
  import DarkSkyApi from 'dark-sky-api';  
  
  @Injectable()
  export class WetterService {
  
    /***
     * Konstruktor
     */
    constructor() {
      this.skyApi = this.InitDarkSky();
    }
  
    /**
     * Die Verbindung zur API Darksky initalialisiern
     */
    private InitDarkSky(): IDarkSkyApi {
      const darksky: IDarkSkyApi = new DarkSkyApi(this.ApiKey);
  
      // Ansteuern der Api
      return darksky
        .units('si')
        .language('de');
    }
  }
  </code></pre>
  
  <p>and this is the test to the service:</p>
  
  <pre><code>import { TestBed, inject } from '@angular/core/testing';
  
  import { WetterService } from './wetter.service';
  import {HttpClientModule} from '@angular/common/http';
  import DarkSkyApi from 'dark-sky-api';
  
  describe('WetterService', () =&gt; {
    let darkSkyApi: DarkSkyApi;
  
    beforeEach(() =&gt; {
      darkSkyApi = new DarkSkyApi();
      TestBed.configureTestingModule({
        providers: [
          WetterService
        ],
        imports: [HttpClientModule]
      });
    });
  
    it('should be created', inject([WetterService], (service: WetterService) =&gt; {
      expect(service).toBeTruthy();
    }));
  });
  </code></pre>
  
  <p>When i run the test i become follow error:</p>
  
  <p>TypeError: dark_sky_api_1.default is not a constructor</p>
  
  <p>I hope so you can help. </p>
  
  <p>Thanks,
  Steffen</p>