Debug QUnit tests using debugger

Hello, recently I was working on a project where we were using QUnit test. And I needed debug piece of my code that wasn’t working correctly and I found that very difficult task, because when you run the test, you can not simply debug it in a browser console.

So I had to find another solution how to debug javascript code in a browser console.

This is a solution that worked for me:

Prerequisities:

Firefox browser, with firebug plugin installed

First of all you need to set Firefox as a default browser or you can set that you want to run javascript test in Firefox

I’m using for example Resharper to run my test so I can set that in configuration like this:

Another step is to configure firebug correctly. You have to configure that every page has by default activated firebug console window.

And that is all.

Now:

1. open your firefox browser (You have to have at least one opened window, because of a firebug console.)

2. run a test

And your code should break on a debugger. And now you can simply debug your code by using debug controls