title: Karma throwing 'Uncaught TypeError: Cannot read property 'plugins' of undefined', despite being in my index.html and karma.conf.js file
body: <p>I have been tasked with setting up unit tests for a legacy AngularJS application (none currently exist, so I am setting it all up). However, I have been running into some issues getting my initial test to run. I've been peeling the onion of errors for a while now, but I'm stuck on this current one. </p>
  
  <p>When I run the command 'karma start', it throws the following error (<strong>It must be noted that I am only getting this error while trying to run my unit test, it does not occur when I build the application to run locally</strong>):</p>
  
  <pre><code>"message": "Uncaught TypeError: Cannot read property 'plugins' of undefined at Web/js/plugins/flot/curvedLines.js:308:12
  </code></pre>
  
  <p>And that line is the following code: <code>$.plot.plugins.push(</code></p>
  
  <p>I've read multiple github and stackoverflow links, and I've followed their advice, but I am still running into the issue. I have tried putting the script tags near the top of my index.html file, and my karma.conf.js file is definitely including the files for the flot plugin through the line:</p>
  
  <pre><code>'Web/js/plugins/**/*.js',
  //the full path for the plugin is 'Web\js\plugins\flot'
  </code></pre>
  
  <p>However, I did notice that there is a 'jquery.flot.js' file. <strong>Will the line in my karma conf above include that jquery file?</strong> As an experiment, I also included the following line in my karma.conf.js file:</p>
  
  <pre><code>'Web/js/plugins/flot/jquery.flot.js'
  </code></pre>
  
  <p>However, when doing so, Karma throws <em>another</em> error. This time, saying that I am not loading my main app module, with the exact error being:</p>
  
  <pre><code>Uncaught Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it.
  </code></pre>
  
  <p>However, I am loading my application at the very top of my unit test file in a before each statement, so I don't know why this would be throwing an error. Additionally, my app is not just called 'app', it has a different name, and I have that differently named module included properly.</p>
  
  <p>So right now, I am a bit lost. <strong>Am I on the right track with including that jquery.flot.js file explicitly in my karma.conf.js file? Or is that the wrong approach and I should only have the</strong> <code>'Web/js/plugins/**/*.js'</code> <strong>line? If so, where should I look next?</strong></p>
  
  <p>Thanks in advance.</p>