So, for the past couple of months I’ve been investigating a variety of topics from top-to-bottom, including HTML5 and CSS3, Bootstrap, ASP.NET MVC, Entity Framework (including Repository, Unit of Work, and Service patterns), Dependency Injection, JavaScript (including the Module and Revealing Module patterns) and jQuery, KnockoutJS, and finally QUnit.
One topic I thought I’d blog about is how to unit test client-side JavaScript code, specifically ViewModels used by KnockoutJS that communicate with a Web API endpoint. To help illustrate these techniques I’ve created an ultra-simple ASP.NET MVC application that uses both Web API and KnockoutJS. Shockingly, it’s a to-do application.