Recently I spent a good twenty minutes tearing my hair out over a JavaScript unit test I was trying to write. The answer turned out to be a difference in the way our Mocha-based DOM differs from how it would running JavaScript in a browser.
For example, let’s say you have a select field.
<select name="test" id="test">
<option value="">Select an option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
In a browser, the top option would be selected by default, so if you had the following code:
jQuery('#test').val();
It would output a blank value as you would expect. However, run this in Mocha and you will get an undefined or a null. The reason is Mocha doesn’t select the top option by default unless you manually specify it to. So your HTML would have to look like:
<select name="test" id="test">
<option value="" selected="selected">Select an option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
In which case, it would then return the value as it should.

This notice was in a broken lift in Manchester. It was clearly broken due to the number of signs around it and the fact that the doors were held open. But they also felt the need to post an “urgent” notice.
I’m not quite sure what was urgent about it. Though they have put it in quote marks, so maybe they don’t know either.

After the last series of desk moves, I’ve found myself facing into the sun. There are blinds, but they’re ineffective, so to prevent myself from behind blinded I’ve had to carefully erect my umbrella to provide a sun screen. Feels like such a stereotype.
On the last Sunday of September, we held the Area 15 contest for humorous speaking and table topics. The competition was tough and all competitors did a great job – congratulations to all that took part!
Despite having lost at the club contest, only to win through at White Rose, I somehow came out on top in humorous speaking. Two contestants go through to Division so Jamie will be joining me with a speech entitled “The TM 2 1 3 1” as well.
Chanaka once again stormed through the Table Topics and will be going to the division contest alongside Michael who also gave an excellent speech. I’m also pleased to say Michael took home the Toastmaster of the Year award for his ever-present hard work for the area.

October 4th, 2013 |
Books
When I read the Wikipedia page on this novel, it described it as being on of the greatest works of literary nonsense ever written. High praise indeed.
The title is often shortened to Alice in Wonderland, which lets be honest, is a far snappier title. Though not technically a correct one. The film adaptation released a few years ago also chose to shorten the name.
As a children’s book, it was a relatively short read and kept the pace moving along at a good pace so even I didn’t get too bored any any point. It does leave you thinking that real life is rather boring though.

October 3rd, 2013 |
Books
Having been watching the TV series, I’ve also been reading the book as well.
It’s not been a bad read, but I really think it speaks highly of the TV series that actually includes most of the details.
Sadly, I can’t think of a better example than Harry Potter. But if you take Harry Potter, the novels are great because they contain large story arcs and extra details that are entirely missing from the films. I didn’t find this to be the case with A Game of Thrones – the TV series has covered pretty much all the book.
As I’ve said, that isn’t really a fault of the book though, which was definitely worth a read.
