009 JSJ Testing Javascript with Joe Eames




Javascript Jabber show

Summary: Panel Joe Eames (Pluralsight bio) Charles Max Wood (twitter github Teach Me To Code Rails Summer Camp) Jamison Dance (twitter github blog) Discussion TDD Unit testing Community driven development patterns Selenium Selenium Web Driven Integration Tests UI Tests BDD Tests are only as good as their authoring javadoc Typed.js Heckle Mutation Testing mocha jasmine qunit test anything reporter browser testing landing strip test reporter mocha does well with asynchronous code qunit is like xunit YUI teamcity Continuous Integration jsTestDriver Can you run DOM tests without a browser? Phantom.js sinon.js Spying on functions Test doubles Start with stubs Move to mocks where needed Given-When-Then Outside-In Mocks aren't Stubs by Martin Fowler Don't mock objects you don't own Abstract away libraries you don't own TestDrivenJS.com TestDrivenJS.com Resources page regressions Picks unmute (Jamison) GoodReads (Jamison) Bootstrapping Design (Jamison) Apparat (Jamison) Things (Chuck) iPad (Chuck) Last Will (Joe) Psych (Joe) The Tower of Fear by Glen Cook (Joe) Touch (Joe) Transcript CHUCK: Hey everybody and welcome to episode 9 of the JavaScript jabber podcast. This week, we are going to be talking about Testing JavaScript with Joe Eames. Joe do you wanna go ahead and introduce yourself really fast and then we'll do the rest of the introductions and start talking? JOE: Sure. Thanks Chuck. My name is Joe Eames and I've been a web developer for a very long time and I'm the creator of testdrivenjs.com it’s kind of my own personal quest to bring better unit testing and test driven development to the JavaScript world. That’s pretty much me. CHUCK: All right. Thanks, Joe. I've actually had lunch with Joe a few times. I organized lunches for the JavaScript group here. And yeah so I’d organize them up in Murray -- which is a suburb of Salt Lake City and yeah, Joe and I have had one-on-one lunches twice now, I think. JOE: Yup. CHUCK: Yeah, so I might just start scheduling lunch with Joe and then stop scheduling JavaScript lunches at Salt Lake county. [Laughter] JAMISON: That will probably be really romantic though. CHUCK: Yeah we should have lit a candle in the last one. JOE: We should have. CHUCK: Yeah absolutely. Anyway, we also have Jamison Dance on the podcast. JAMISON: Hi I'm Jamison Dance. I'm a web developer and JavaScript developer in Utah. CHUCK: All right. I'm Charles Max Wood form teachmetocode.com. I guess were all from Utah this week. JAMISON: Oh, yeah. CHUCK: Yeah so anyway… so really interesting, for me anyway, is that I used to complain a lot that I would write JavaScript and then I couldn’t test it because I'm pretty accustomed to testing my Ruby code. And so, Joe did a presentation at the… was it the last meeting that we were at or the meeting before that? JOE: The last one. CHUCK: Yeah about doing TDD with JavaScript and I'm sitting there going, “Ooh, this is speaking right to me.” And so, I'm a little curious Joe what your take is as far as how TDD works with JavaScript versus maybe doing TDD with other languages or frameworks? JOE: Well it’s pretty interesting, the difference in opinions and views. It seems like there's  very large amount of people that are realizing, “Oh we do need to unit test JavaScript,” but very few people are saying we need to test drive our JavaScript the way that many people are saying we need a test our middle tier code. So I think the biggest difference by far is in the community. Having them a fair amount of test driven JavaScript, I would say that there's some differences for sure; where some of the tooling is lacking still especially from the stand point of being… from the perspective of doing test-driven JavaScript, the tooling is lacking. But in the end, there really isn’t any difference. In fact,