Category Archives: testing

JavaScript Unit Tests: Jasmine vs Mocha

Someone recently asked me whether I prefer Jasmine or Mocha for unit testing JavaScript. My answer is: Jasmine and Mocha are both great. I use both, depending on the project and team. There’s a great community around both, and you’ll … Continue reading 

| 7 Comments

Isolating database data in integration tests

Databases in tests is an annoying, yet necessary component if you truly want to create accurate integration tests. I’m not too much of a fan of employing alternate databases in tests (SQLite in place of SQL Server), simply because I … Continue reading 

| 39 Comments

Asynchronous Unit Tests With Mocha, Promises, And WinJS

Before I get in to the guts of this post, you need to read Christopher Bennage’s post on how we have our Mocha test suite set up for our Win8 / WinJS project. It’s not the best setup, but it … Continue reading 

| 12 Comments

Jasmine-BDD: A Screencast On The Standalone Test Runner

My 2nd screencast at WatchMeCode.net is now online, and is free! WatchMeCode Episode 2: The Jasmine Standalone Runner In this episode, I cover the basics of JavaScript testing with the Jasmine-BDD test framework, showing how to install and use the … Continue reading 

| 2 Comments

Custom Jasmine Matchers For Clarity In Testing Backbone.js Models

I’ve been writing some Jasmine specs for a sample Backbone.js application that I’m building. The application is a simple image gallery, and one of the features is the ability to navigate to through the image list with ‘next’ and ‘previous’ … Continue reading 

| 1 Comment

Tracking down a strange issue with WatiN and IIS Express

In my current project, we have a system that runs our Watin tests using NUnit. We also want to run the tests in our CI build, so we start IIS Express in a [SetUpFixture]. Today I was doing my check … Continue reading 

Also posted in git, posh-git, powershell | 2 Comments

Mocks, Stubs and Unreadable Tests: Clearly I’m Doing This Wrong

I tweeted this a few minutes ago: This is in reference to a horrible test that I wrote today. It’s got 2 assertions and more than 20 lines of context to set up the mocks that I needed, to isolate … Continue reading 

| 19 Comments

AutoMapper Tests Made Simple

I work primarily on a C# ASP.NET MVC application that deals with many other systems which seem to dish out strings all over the place. Hence the need for something like AutoMapper. When converting this data into objects or enumerations, … Continue reading 

| Leave a comment

Verifying Generated HTML With HAML, Cucumber, Capybara and RSpec

Several of the reports that the app that Joey and I are working on will be generated via HAML to be displayed in the app, for the users. The generated content will end up being HTML, but starts it’s life … Continue reading 

| Leave a comment

A Semi-Intelligent Watchr Script For Rails And RSpec

I’m using Watchr in my current Rails 3 project, instead of Autotest, to run my Cucumber and RSpec tests whenever I save a file. It makes life so much easier than having to manually run them. Yesterday, I decided to … Continue reading 

| 2 Comments