Last time, we completed the scaffolding of our little web app.
This time, we'll make it actually do something - and perform a little refactoring along the way. I'll also talk a bit about more advanced features of mocha.
Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts
Thursday, 9 May 2013
Friday, 26 April 2013
Test Driven UI Development with Node, Mocha and RequireJs (part 2)
Last time, we set out a framework for doing test driven development with our front end code.
Now we're going to build on that scaffolding to create a simple web app, adding modules as necessary as we go.
Now we're going to build on that scaffolding to create a simple web app, adding modules as necessary as we go.
Wednesday, 24 April 2013
Setting up TDD on a Mac with iTerm2 and vim
In order to get anywhere with TDD, it is vital to set up your development environment so that re-running tests is either automatic, or requires only a single keypress.
Here's how I have things set up...
Here's how I have things set up...
Tuesday, 23 April 2013
Test Driven UI Development with Node, Mocha and RequireJs
Test driven development, or TDD, is often held up as an ideal to aim for in unit testing. Its simple premise of write a test, pass the test, refactor the code - or red, green, refactor - leads to good coding habits.
But testing your front end javascript code is hard... just getting it into a position where you can test it at all is tricky, and following examples on the web will tie you in knots. Then there's yet another problem... dependency injection. With so many hurdles to jump, it is little wonder that many projects have a handful of fragile integration tests that leave you wondering whether the trouble was worth it.
I'm going to attempt to lay out a method by which front-end code can be readily unit tested, without needing a headless browser.
But testing your front end javascript code is hard... just getting it into a position where you can test it at all is tricky, and following examples on the web will tie you in knots. Then there's yet another problem... dependency injection. With so many hurdles to jump, it is little wonder that many projects have a handful of fragile integration tests that leave you wondering whether the trouble was worth it.
I'm going to attempt to lay out a method by which front-end code can be readily unit tested, without needing a headless browser.
Wednesday, 10 October 2012
Android ICS and target-densityDPI
I was debugging an interesting issue on our mobile site recently, and the problem came down to densityDpi
This attribute in the viewport meta tag for android devices is documented here: http://developer.android.com/reference/android/webkit/WebView.html
On Gingerbread and Jellybean, the shrinkage would only affect the offending page, but on Icecream Sandwich, when we then navigated to another page, we would find the whole page had shrunk - and it would continue to display "zoomed out" pages until we reset the browser settings.
This attribute in the viewport meta tag for android devices is documented here: http://developer.android.com/reference/android/webkit/WebView.html
So what's the problem?
We have a little pull-down console that is included in pages whose content is mainly under the control of a third party supplier (I won't go into the complexity there). This console would shrink down during the page load.On Gingerbread and Jellybean, the shrinkage would only affect the offending page, but on Icecream Sandwich, when we then navigated to another page, we would find the whole page had shrunk - and it would continue to display "zoomed out" pages until we reset the browser settings.
Friday, 7 October 2011
Crowdsourcing Debian Administration Handbook
The authors of a French-language administration handbook for Debian are crowdsourcing the funding required to translate it into English.
If they raise enough, they will "liberate" the book, publishing it under a free licence.
(Not just of use to Debian administrators, I'm sure there's plenty of material that would apply to wider linux administration or at least to Debian derivatives like Ubuntu etc..)
Update: Get the book now!
http://debian-handbook.info/get/
If they raise enough, they will "liberate" the book, publishing it under a free licence.
(Not just of use to Debian administrators, I'm sure there's plenty of material that would apply to wider linux administration or at least to Debian derivatives like Ubuntu etc..)
Update: Get the book now!
http://debian-handbook.info/get/
Monday, 26 September 2011
Never lose a file again - 8 tips to manage your files
Ever lose a file? It's not like losing your keys, sometimes the file that you lost came from your camera and is named something unhelpful like "D879691.JPG".
Using the tools to search for files won't help if you have hundreds of photographs on your computer.
Everyone forgets that files on a computer are just like their metaphorical analog in real life - they need organizing or finding what you want will be difficult.
So, here's some general do's and don'ts to help you to organize your files.
Using the tools to search for files won't help if you have hundreds of photographs on your computer.
Everyone forgets that files on a computer are just like their metaphorical analog in real life - they need organizing or finding what you want will be difficult.
So, here's some general do's and don'ts to help you to organize your files.
Subscribe to:
Posts (Atom)