Note that there are some explanatory texts on larger screens.

plurals
  1. POGeneral unit testing concepts/practices in JavaScript against different browsers?
    text
    copied!<p>I’ve been writing unit tests in strongly typed languages and I have a fair good understanding about it. When writing unit tests in JavaScript to verify if certain functions are working properly in certain browsers I am back to the manual testing. I have no understanding of how it works. <strong>Because JavaScript is meant to close the gap between data and presentation and make it more interactive. And everything is happening within browsers and it's more to do with UI.</strong> So I am assuming that if I were going to write a unit test I would write something like (in pseudo code):</p> <pre><code>run function A check DOM if certain element has been created if not then fail check if element is visible if not then fail check for the content of that element if null then fail etc… </code></pre> <p>Writing these tests seem like “hard coding” to me and what’s missing is that the tests wouldn’t be able to tell if it’s been rendered properly, it's only doing the pure functional tests. So I am wondering if someone can explain to me what are the proper test procedures in JavaScript, how to do build automations and some general concepts in doing it. I was just looking at <a href="http://testswarm.com/" rel="nofollow noreferrer">John Resig's project testswarm</a> but yet to figure out what it’s about. I am also reading about <a href="http://docs.jquery.com/QUnit" rel="nofollow noreferrer">QUnit</a> at the moment.</p> <p>I am looking for some introductory materials on the concepts/practices that can me started. I am not looking for specific libraries or tools unless they have good introduction on the concepts.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload