Erik A. Hanson's Weblog

Archive for the 'Unit Testing' Category

Solutions To Slow Test Suites

Posted: Friday, June 5th, 2009    Tags: Selenium, Unit Testing

As a proponent of test driven development, I’m naturally a big fan of writing automated tests.
Often, clients who are new to writing automated tests start out by writing big integration tests (with tools like Selenium). This is an easy way to start testing an app that wasn’t written with testability in mind.
Unfortunately, these sorts [...]

Running Jasmine Tests Through Jaxer

Posted: Thursday, June 4th, 2009    Tags: Jasmine, Javascript, Jaxer, Unit Testing, Web development

Jasmine? Jaxer?
Jasmine is a new Javascript testing framework from my pals at Pivotal Labs.
Jaxer is an Apache module that wraps Firefox’s Javascript and rendering engine, providing a server-side Javascript environment that’s fast and compatible with any JS that works in Firefox (including all kinds of DOM manipulation and libraries like Prototype, jQuery, etc.).
Running Jasmine [...]

Firing mouse events in tests

Posted: Tuesday, January 1st, 2008    Tags: Javascript, JsUnit, Unit Testing, Web development

The Bad News
Sending mouse events such as click and mouseover in JsUnit tests can be really hard.
More Bad News
Prototype doesn’t make it any easier. Sam Stephenson says:

We would very much like to support it in the future. It’s fairly complicated to implement native event firing across all supported browsers, so in 1.6.0, fire works [...]

Big New Feature In JsUnit 2.2 alpha 25

Posted: Monday, August 13th, 2007    Tags: Javascript, JsUnit, Unit Testing

In order to run all test functions in a test page, JsUnit naturally needs to know what those test functions are. It’s able to get a list of those functions from Firefox, Safari and Opera, but it’s not able to get them from Internet Explorer. So in IE, JsUnit has to resort to searching the text of all scripts for strings that look like test function names. Unfortunately, it doesn’t understand comments so commented-out test functions will end up running anyway.

Minor New Features In JsUnit 2.2alpha24

Posted: Thursday, August 9th, 2007    Tags: Javascript, JsUnit, Unit Testing

I added a few new features to JsUnit and tagged it as version 2.2 alpha 24: new log button, new URL parameters, and easier suite creation.