title: Angular 4 + Karma - Unexpected token var
body: <p>I've just migrated my app from Angular 2 to Angular 4. Before I used Karma for unit tests. After migration I try to run tests using <strong>npm test</strong> (like I did it before). But this time I have compilation error says this
  <a href="https://i.stack.imgur.com/p4UYz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p4UYz.png" alt="enter image description here"></a></p>
  
  <p>P.S. <strong>npm start</strong> compiles the app perfectly.</p>
  
  <p>It looks like karma can't recognize TypeScript file for some reasons. What does it mean and what is the possible way to fix it?</p>