Contact Me

How do I Write Testable Javascript so I can Test my CF API on Server and Client??

Presentation by Gavin Pickin

November 10, 2015
11:00 AM - 12:00 PM

Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API?

Everyone who wasn't writing JavaScript, probably is now. Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript. That's great, but how do we test it. In ColdFusion we have CFCs, most languages have classes... but JavaScript doesn't have classes (yet). So how do I write unit tests, what units are there, and how do I make my code look like that.

We build our CFCs and CF API to be consumed with AJAX, and like Server Side, we need to be able to test our CFC endpoints, and the Javascript that uses them. Testing serverside with Testbox and Clientside with Jasmine. With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.

Take your JavaScript spaghetti and make it unit testable. Test your API on Server and Client.

Attendees will learn

Attendees should have some exposure to Unit Testing Ideas, CFCs as endpoints or CF API creation, and consuming with JavaScript, but this is for the Professional Newbie... who always needs to learn and adapt.

Presentation Slides

Sample App

Additional Resources, Links and Walkthroughs

This topic is not an easy one to fit into a 50 minute session... so to help attendees, and those reading along with the slides at a later time, these resources and walkthroughs, links etc, will help you with other pieces of the puzzle that I lightly breeze over in the main presentation.

Testable Javascript - Presented at dev.Objective() 2015

Check back as I blog on more detail all the subjects I covered

Recommended Books