title: How do I get 'npm test' to find my karma.conf.js file?
body: <p>I have the following structure in my application:</p>
  
  <pre><code>Web (Asp net core)
  |
  |--wwwroot
  |--ClientApp
  |  |--app
  |  |  |-- ... (typescript modules, *.spec.js files etc.)
  |  |
  |  |--karma.config.js
  |  |--test-main.js
  |
  |--Controllers
  |--config.json files for web etc.
  </code></pre>
  
  <p>In the console I'm in the ClientApp folder when running:</p>
  
  <pre><code>npm test
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>File C:\Users\...\Web\karma.conf.js does not exist!
  </code></pre>
  
  <p>Why does it try to look for the <code>karma.conf.js</code> file in the Web folder?</p>
  
  <p>How can I tell it to look in the right place? Even if I CD to the app folder I get the exact same error.</p>
  
  <p>If I try to place the karma.conf.js file where it expects it, I get a bunch of other errors like:</p>
  
  <pre><code>cannot find module requirejs
  </code></pre>
  
  <p>I'm horribly confused, would really appreciate some help. </p>
  
  <p>karma.conf.js file:</p>
  
  <pre><code>module.exports = function(config) {
  config.set({
  
  basePath: '',
  frameworks: ['jasmine', 'requirejs'],
  files: [
    'test-main.js',
    {pattern: 'test/**/*spec.js', included: false},
    {pattern: '*.js', included: false}
  ],
  exclude: [
  ],
  preprocessors: {
  },
  reporters: ['progress'],
  port: 9876,
  colors: true,
  logLevel: config.LOG_INFO,
  autoWatch: true,
  browsers: ['Chrome', 'Firefox'],
  singleRun: false,
  concurrency: Infinity
  })
  }
  </code></pre>
  
  <p>test-main.js:</p>
  
  <pre><code>var allTestFiles = []
  var TEST_REGEXP = /(spec|test)\.js$/i
  
  Object.keys(window.__karma__.files).forEach(function (file) {
    if (TEST_REGEXP.test(file)) {
      var normalizedTestModule = file.replace(/^\/base\/|\.js$/g, '')
      allTestFiles.push(normalizedTestModule)
    }
  })
  
  require.config({
    baseUrl: '/base',
    deps: allTestFiles,
    callback: window.__karma__.start
  })
  </code></pre>