On Thu, Sep 13, 2012 at 6:02 AM, Tom MacWright <span dir="ltr"><<a href="mailto:tom@macwright.org" target="_blank">tom@macwright.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

+1 for Javascript testing in general, though I don't think that our JS code in its current state is well-written for tests - it's too much a bundle of interconnected DOM logic to be easily split up into unit tests.</blockquote>

<div><br></div><div>Too true -- something to work towards as we clean it up.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Also, while I'm a big fan of mocha for nodejs tests, I'm skeptical of its browser support - it seems to fail entirely in IE, which is kind of the point of browser testing for me. Is this just me making a mistake? Jasmine has fared better in multiple browsers afaik.</div>

</blockquote><div><br></div><div>What IE version, and what did you try? Both mocha and chai aim for cross-browser support. The known exception is chai's "should" syntax, which can't be supported on IE<10. I've switched my pull request to use the "expect" syntax, which is more compatible.</div>

<div><br></div><div>To be honest though, I'm of a different opinion about the point of browser testing. I've never got a lot utility from automated cross-browser testing, and I think browser testing is useful for other reasons. I haven't found cross-browser script issues to crop up much in the type of code I typically get under test, and JS tests don't help with finding rendering problems, which (in my experience) are the majority of cross-browser issues. So in practice cross-browser validation tends to be a manual process anyway. However, browser testing is really useful, principally because a) I do actually want the DOM under test some of the time and non-browser DOM implementations inevitably fail sooner or later and b) browsers have by far the best tooling for debugging test failures.</div>

</div>