Testing JavaScript code

Alexander Paterson offers a guide around TDD in NodeJS here.

Jasmine from here was once recommended to me for its super-simple syntax.

Manually inspect source code

To preview data structures in JavaScript, you can use some of the functions mentioned there:

console.log

console.log(my_object)

pretty-print

console.log(JSON.stringify(myObject, null, 4));

util.inspect

const util = require('util')
console.log(util.inspect(my_object))

console.dir

console.dir(my_object)