I'm new to testing in general, and have been teaching myself Jasmine. I'm trying to understand the differences between running Jasmine and jQuery-Jasmine in Karma vs running Jasmine by itself. The tutorials for Jasmine don't address the adjustments that are needed if using Karma.
Can someone explain to me how Karma-Jasmine differs in requirements from the standalone Jasmine? Does it still require a spec runner, and is the file structure still the same?
I'm testing DOM events - a lot of click handlers - and don't understand how to mock this. Can someone outline some basic ideas? If I want to, for example, check that a p element has been added to a div after a user clicks a button, how would that work in both file structure and functions?
Thanks.
Karma and Jasmine's SpecRunner.html are both test runners (aka spec runners). The difference between the two is that Karma is an application that runs outside the browser, while SpecRunner is a normal HTML file with a bunch of script references that you open up in a browser.
A test runner that lives outside the browser gives you a number of benefits:
<script>
references in a HTML fileIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With