JS unit testing meetup on the 20th, and intro to Node.js class on the 13th

17 views
Skip to first unread message

Domenic Denicola

unread,
Aug 3, 2012, 3:08:27 PM8/3/12
to ny...@googlegroups.com
My HTML5 app devs meetup group is hosting a meetup on JS unit testing on the 20th, at Facebook NYC:


Unit Testing for Great Justice with Domenic Denicola

The discovery of unit testing and test-driven development was one of the most important parts of my growth as a developer. The ability to write simple, small pieces of code that could verify the behavior of my application was in itself quite useful. And the ability to refactor without fear, just by running the test suite, changed how I program. But the real benefits come in how unit tests shape your application code: more testable code is often more well thought-out, more decoupled, and more extensible.

In this talk, I'll give a whirlwind introduction to unit testing as a concept and as a practice. I want you fully convinced it's the best thing to happen to software development, if you aren't already. Once we're on the same page there, I'll take a deep dive into what makes a good unit test. This involves testing tools such as spies, stubs, and mocks, concepts like code coverage, and practices like dependency injection that shape your application code. The most important lesson will be on how to focus on singular, isolated units of code in your testing, as this guides you toward building modular, flexible, and comprehensible applications.

 

Client Side Unit Testing for Single Page Applications with John K. Paul

The unit testing web developer population, in general, has been growing by leaps and bounds, but sadly those gains haven’t been as steady on the client side.  I’d like to address a few of the reasons why that is, and how we can change that by unit testing our client side application code as thoroughly as possible.

Most unit testing examples focus on very straightforward imperative tests. I have seen many explanations of JavaScript unit testing that describe how to verify the logic behind a calculator or a form validation library, but not how to test a more complex, event triggered application.  I’ll walk you through a simple unit tested Backbone application and explain some design tips for effectively unit testing your code along the way.  After that, I will explain how to effectively mock Ajax requests and trigger Ajax events from your unit tests.

I will also be giving a short introduction to the grunt build tool. I’ll show you how to setup grunt in such a way that your test output can be easily integrated with your continuous integration suite as well as run every time you change a file.  Hopefully, eventually, we’ll all be able to have the confidence inspired by the green and red lights on a build monitor, on both sides of the great HTTP divide.


Also, I'm teaching a short class on "Understanding the Node.js Platform" at General Assembly on the 13th:

Node.js is an exciting new platform for building web applications in JavaScript. With its unique I/O model, it excels at the sort of scalable and real-time situations we are increasingly demanding of our servers. And the ability to use JavaScript for both the client and server opens up many possibilities for code sharing, expertise reuse, and rapid development.

This class is intended for those with some basic knowledge of JavaScript, interested in an introduction to the Node.js ecosystem and development platform. We'll discuss how to get started with Node, and why you would want to. We'll then explore Node's module and package system, demonstrating several of the more popular and impressive packages that exemplify the type of tasks Node excels at. These include low-level HTTP streaming with the http module, high-level bidirectional websocket communication with socket.io, and server-browser code sharing with browserify, jsdom, and node-canvas.

Basic knowledge of JavaScript preferred, but not necessary: this course is intended to be a useful introduction for nontechnical types as well, explaining why Node.js would benefit their technical team.


Hope these are of interest to some of you out there!

Reply all
Reply to author
Forward
0 new messages