Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1y83Vwi.
Pamela Selle introduces testing to JavaScript developers, showing how to make sure that the /js folder is not becoming a load of technical debt. Filmed at qconnewyork.com.
Pam Selle is an engineer in Philadelphia, PA where she works at Comcast on xfinity.com. Pam speaks at user groups and conferences on JavaScript, HTML5, and CSS. She organizes Philadelphia's premier JavaScript user group, Philadelphia JavaScript Developers, and organizes the yearly Philly Code Retreat that introduces many local developers to test-driven development.
2. Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/tdd-javascript-2014
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
3. Presented at QCon New York
www.qconnewyork.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
4. About me
• Software developer for Xfinity.com
• Online: thewebivore.com, @pamasaur
• Co-organizer of Philadelphia JavaScript Developers
• Testing fanatic
5. Agenda
• My testing story
• Writing your first JavaScript test
• Testing frameworks
• Working testing into your workflow
19. var assert = require('assert');
describe("An area of my application", function() {
it("should know that 2 and 2 is 4", function(){
assert.equal(4, 2+2);
});
});
20. describe("An area of my application", function() {
it("should know that 2 and 2 is 4", function(){
assert.equal(4, 2+2);
});
});
21. var assert = require('assert');
describe( , function() {
it("should know that 2 and 2 is 4", function(){
assert.equal(4, 2+2);
});
});
22. var assert = require('assert');
describe("An area of my application", {
it("should know that 2 and 2 is 4", {
assert.equal(4, 2+2);
});
});
23. var assert = require('assert');
describe("An area of my application", function() {
it( , function(){
});
});
26. Spies, stubs, and mocks
• Spy: an object that records its interactions
• Stubs: fake objects
• Mocks: fake objects with expected behavior
Generally, you can SPY on a function, STUB an
object, and MOCK a service.