title: How to import json file to be available in angular-cli npm test
body: <p>Given angular version 4.2.4 with angular-cli (version 1.1.3) and following code:</p>
  
  <pre><code>import languagesJsonRaw from './languages/en.json';
  import countriesJsonRaw from './countries/en.json';
  
  export const languages = prepareLanguages(languagesJsonRaw);
  export const countries = prepareCountries(countriesJsonRaw);
  </code></pre>
  
  <p>This works when I run <code>npm start</code> (which triggers <code>ng serve</code>) - <code>languages</code> and <code>countries</code> are available to the application.</p>
  
  <p>When I run <code>npm test</code>, which basically triggers:</p>
  
  <pre><code>ng test --reporters dots,html --browsers Chrome --watch
  </code></pre>
  
  <p>then <code>languagesJsonRaw</code> and <code>countriesJsonRaw</code> are undefined. </p>
  
  <p>How can I provide those files also to the test runner? I don't think we needed to do anything special for them to be available from <code>ng serve</code> or <code>ng build</code>, works even with AOT.</p>
  
  <p>It's default angular-cli project, so test runner is karma I think.</p>
  
  <p><strong>Github Issue</strong>: <a href="https://github.com/angular/angular-cli/issues/6786" rel="nofollow noreferrer">https://github.com/angular/angular-cli/issues/6786</a></p>