title: jQuery is not defined error in karma tests
body: <p>I am using jQuery in my angular 5 app which works perfectly but I have an issue with karma tests.</p>
  
  <pre><code>import { ElementRef } from '@angular/core';
  declare var jQuery: any;
  
  export class Item {
  
  constructor(private element: ElementRef) {
      this.init();
  }
  
  private init() {
      this.$item = jQuery(this.element.nativeElement);
  ...
  </code></pre>
  
  <p>error</p>
  
  <p>ReferenceError: jQuery is not defined.</p>
  
  <p>package.json</p>
  
  <pre><code>"dependencies": {
    "jquery": "3.1.1"
  }
  </code></pre>
  
  <p>I have added jquery to my karma.conf but that didn't help.</p>
  
  <pre><code>files: [
          'node_modules/core-js/client/shim.js',
          'node_modules/systemjs/dist/system.src.js',
          'node_modules/zone.js/dist/zone.js',
          'node_modules/zone.js/dist/proxy.js',
          'node_modules/zone.js/dist/sync-test.js',
          'node_modules/zone.js/dist/jasmine-patch.js',
          'node_modules/zone.js/dist/async-test.js',
          'node_modules/zone.js/dist/fake-async-test.js',
          'node_modules/tslib/tslib.js',
          'node_modules/jquery/dist/jquery.js',
  
          {pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
          {pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
          {pattern: '../karma-test-shim.js', included: true, watched: true},
          {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
          {pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
          {pattern: 'node_modules/@ng-idle/core/bundles/core.umd.js', included: false, watched: false},
          {pattern: 'node_modules/bowser/bowser.js', included: false, watched: false},
          {pattern: 'node_modules/bootstrap/dist/js/bootstrap.js', included: false, watched: false},
          {pattern: 'node_modules/tslib/tslib.js', included: false, watched: false},
          {pattern: 'node_modules/jquery/dist/jquery.js', included: false, watched: false}
      ],
      proxies: {
          "/node_modules/": "../../node_modules/"
      },
      autoWatch: true,
      browsers: ['PhantomJS', 'Chrome', 'HeadlessChrome'],
      singleRun: false
  });
  };
  </code></pre>
  
  <p>can you someone please help? </p>
  
  <p>Thanks in advance.</p>