I awake from the strangest dream last night, and TestEm proves to be incredibly easy to get going and works brilliantly.

Strange dreams

I had the strangest dream last night.

I’m lying in bed and a cellphone in my left hand plays a radio station which wakes me up. How to stop it? It’s a flip-top cellphone that’s not even my own, because that one is in my right hand. The flip-tip phone fades away as I realise I have my own cellphone in my other hand.

I then notice that my computer gear beside me is making a hell of a noise. Why are they on? I normally them off at night. Is that a dot-matrix printer making such racket? I don’t even have one! As I try to reach for them I fall out of bed and float tangled in sheets to the ground.

That’s when I really wake up, in an undisturbed bed with a room that’s quiet all around me.

What on earth was that all about? No wonder people sometimes believe in UFO’s with such experiences occasionally affecting your perception of things.

Testem & PhantomJS

Things couldn’t have gone smoother with Testem. It’s the best of the automated testing systems that I’ve come across yet.

Installing

I already have Node installed, and npm (node packaged modules) from its dist, so it was just a simple matter of globally installing TestEm with:

npm install testem -g

PhantomJS is a headless WebKit that provides easy access for testing, without needing to have another web page open and dedicated to the task.

Once PhantomJS has been extracted to a suitable location, such as C:\Program Files (x86)\phantomjs\ you can then edit environment variables for your account add that to a PATH setting in your user list. That will let phantomjs be easily accessible from anywhere on the command line.

Configuring

You can now create a testem.json config file, to tell TestEm to use PhantomJS when development testing, along with any other settings:

{
  "framework": "jasmine",
  "launch_in_dev": ["phantomjs"],
  "src_files": [
    "src/*.js",
    "src-test/*.js"
  ]
}

Using

And you’re then good to go. TestEm runs all the tests from a command prompt that you can place anywhere. Here’s a shot of TestEm at the bottom of the screen, as I’m working on a new test.

using-testem

 

The only thing to work on now is to find out why the tests are slow when testing within a web browser, and to possibly use a separate device such as a table to view the test results on a different screen.

Advertisements