karma-requirejs icon indicating copy to clipboard operation
karma-requirejs copied to clipboard

Tests running twice

Open gregeinfrank opened this issue 10 years ago • 1 comments

Hey thanks for the tutorial/demo!

I'm having an issue (I'm using grunt-karma) where when I open up the debug.html file, it's inserting this script tag:

<script type="text/javascript">
  window.__karma__.loaded();
</script>

but since I'm now calling window.karma.start when require finishes, the tests are running twice (first time before require loads, and the second time correctly). What should I do to prevent the double start()?

Thanks!

gregeinfrank avatar Sep 04 '14 14:09 gregeinfrank

BTW I did find a hack by putting this in the first line of test-main.js but it just doesn't feel right...

window.__karma__.loaded = function () {};

gregeinfrank avatar Sep 04 '14 14:09 gregeinfrank