title: Using module.exports in jasmine specs
body: <p>I would like to use module.exports in tested js and include it to specification script using require().</p>
  
  <p><strong>cat.js</strong> - file with object I would like to export</p>
  
  <pre><code>var cat = {
      name: "filemon",
  
      meow: function () {
          return "miau";
      },
      walk: function () {
          return "siup siup siup";
      }
  }
  module.exports = cat
  </code></pre>
  
  <p><strong>catTest.js</strong> - spec for cat</p>
  
  <pre><code>var cat = require('../app/cat')
  describe("Cat test", function () {
      it("cat should meow with miau", function () {
          expect(cat.meow()).toBe("miau")
      })
  })
  </code></pre>
  
  <p>When I run the tests using jasmine CLI(downloaded with npm) tests are passed: </p>
  
  <pre><code>marcins-iMac:untitled marcin$ jasmine
  Started
  ..
  
  2 specs, 0 failures
  Finished in 0.004 seconds
  </code></pre>
  
  <p>But when I try to run tests with karma runner <em>module</em> is undefined:</p>
  
  <pre><code>marcins-iMac:untitled marcin$ karma start
  29 04 2016 23:52:29.238:WARN [karma]: No captured browser, open http://localhost:9876/
  29 04 2016 23:52:29.248:WARN [karma]: Port 9876 in use
  29 04 2016 23:52:29.248:INFO [karma]: Karma v0.13.22 server started at http://localhost:9877/
  29 04 2016 23:52:29.252:INFO [launcher]: Starting browser Chrome
  29 04 2016 23:52:30.112:INFO [Chrome 50.0.2661 (Mac OS X 10.11.2)]: Connected on socket /#MJ-R1hm8uQEvSJq9AAAA with id 29613373
  Chrome 50.0.2661 (Mac OS X 10.11.2) ERROR
    Uncaught ReferenceError: module is not defined
    at /Users/marcin/WebstormProjects/untitled/app/cat.js:9
  </code></pre>
  
  <p>Few ideas I got and does not help:</p>
  
  <ul>
  <li>adding require.js to "files" in karma.config.js</li>
  <li>add tested object to window scope(it's ugly and doesnt work with CLI)</li>
  </ul>
  
  <p>If problem may be caused by configuration, project on github: <a href="https://github.com/marcinmierzejewski1024/jasmine-karma-playground" rel="nofollow">https://github.com/marcinmierzejewski1024/jasmine-karma-playground</a></p>