News for hackers. Stuff that matters.

aldnoahzero

I prefer spaces (4 spaces to be precise), because I can write like this:

var abc = something,

    xyz = somethingElse,

    stringOfAbc = abc.toString();

the variable names are neatly aligned on the left side!

Do you write tests for DOM interactions? [JS]

I'm new to writing tests and after learning about unit testing etc, I started writing tests for my app.I keep getting the nagging feeling that I'm doing something worng here and I'm adding tests for the sake of writing tests. I don't have anyone in my office to ask this.Below are the tests myself and my coworkers wrote:1) There's a search bar that gives suggestions as the user types a word...

( Read More... | no comments | on HN )