Jasmine: require is not defined
<p>I did angular2 quick start project through this link: <a href="https://angular.io/guide/quickstart" rel="nofollow noreferrer">https://angular.io/guide/quickstart</a>. The only different is I add code <code>var fs =  require('js')</code> in app.component.ts, it works. But when I write Jasmine unit test for that component, it shows <code>require is not defined</code>, does anyone know how to solve the problem?</p>

<p>Note:</p>

<p>I am using typescript in my whole project.</p>

<p>I have tried to add node typings definition, but it doesn't fix the bug.</p>

<p>Here is my code:
unit-tests.html</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta http-equiv="content-type" content="text/html;charset=utf-8"&gt;
    &lt;title&gt;Ng App Unit Tests&lt;/title&gt;
    &lt;link rel="stylesheet" href="node_modules/jasmine-core/lib/jasmine-core/jasmine.css"&gt;
    &lt;script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"&gt;&lt;/script&gt;
    &lt;script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"&gt;&lt;/script&gt;
    &lt;script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"&gt;&lt;/script&gt;
    ...
&lt;/head&gt;
&lt;body&gt;
&lt;!-- Unit Testing Chapter #1: Proof of life.  --&gt;
&lt;script src="app/app.component.spec.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>