title: Angular 6 include google closure library
body: <p>I want to include <a href="https://github.com/google/closure-library" rel="nofollow noreferrer">google closure library</a> into my angular 6 application. I have applied</p>
  
  <p><code>npm install google-closure-compiler</code> and <code>npm install google-closure-library</code>. </p>
  
  <p>The app can be compiled and running. However, when I trying to run the tests I wrote with <code>ng test</code>, it has error messages: </p>
  
  <pre><code>ERROR in ./node_modules/google-closure-library/closure/goog/boostrap/nodejs.js
  Module not found: Error: Can't resolve 'fs' in './node_modules/google-closure-library/closure/goog/bootstrap'
  
  ERROR in ./node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js
  Module not found: Error: Can't resolve 'promises_aplus_tests' in './node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js'
  </code></pre>
  
  <p>I use the angular official <a href="https://angular.io/guide/hierarchical-dependency-injection" rel="nofollow noreferrer">demo</a> example and I just added the test and installed these two libraries. My guesses are I need to configure <code>karma.conf.js</code>, but I don't know how to do that, does anyone know how to solve this?</p>