I’ve recently been looking into some JavaScript unit testing frameworks. There are many alternatives, and while many of them seem good, very few of them actually matched my requirements: Must be able to run tests from the commend-line Tests should be relatively easy to write
Weekend coding: Add a character counter as the background of a textarea with JavaScript
Have you ever filled a textarea on a page, which had a limit to how many characters you could type into it? Or maybe you are a Twitter user, and as you know, Twitter only displays 140 characters of your tweets. (Not an actual textarea) The other day I was thinking of this: How to effectively communicate how many characters …
Why your mobile site probably sucks
Mobile phones of today can handle big sites fine. They can handle JavaScript quite well too. Then why is it that I constantly encounter crappy mobile versions of sites? What is it that makes these sites so bad, even though they were obviously designed with small screens in mind? While making a special layout for small screens is a great …
How to install Palm Pre/webOS SDK on Windows 7 x64?
Note: latest versions of webOS SDK should install without problems on Win 7 x64. However you are free to try this if you encounter problems with it. Palm has recently released the Palm Pre webOS SDK to the public. Installing it on Windows 7 64-bit is a bit problematic however. When attempting to install it, the setup runs through fine …
Opera Mobile vs. iPhone Safari Mobile
Lately I’ve had the chance to use an iPhone 3G. As I’ve been considering purchasing the new 3G S, this has been a good opportunity to see if I like the thing, but what I think of the phone itself is a matter of another post – Today, let’s look at its browse and compare it to Opera Mobile, which …
Opera Command, JavaScript based Missile Command game
Firstly I’d just like to let you know that the lack of posts lately is because I have a new full time job which I’m enjoying quite much so far, but it still means I have less time / motivation to write stuff. The unit testing series and other postings will continue (see how I didn’t say “next week”, but …
Unit testing 5: test-driven development
In this post I’ll introduce the methodology known as test-driven development, and how to use it in your projects. The difference between “normal” and test-driven development (TDD) is that when doing TDD, you write unit tests for your new code before writing the code itself. This way you ensure good test coverage for your code, and your code will also …
TankWar Online, my JavaScript based cannons game
Back in late 2006 I wrote my most ambitious JavaScript/game project so far: TankWar Online, which as you may guess from the name was about tanks, shooting stuff, and it had a real-time online game mode – as far as I know, the first such ever in a JS based game. Originally the game was made for an older version …
Unit testing 4: Mock objects and testing code which uses the database
After learning to write tests and some good testing practices, it’s now time to look at mock objects. When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in – a mock object is a “clone” of an object, …
Unit testing 3: Writing tests for existing code
Now that you know what unit testing is and how to write and run tests, it’s time to look at writing tests in more depth. Today we’ll take an example class and write tests for it. We’ll also introduce some common testing methodologies.