- unit tests currently use assertions (not unit test framework)
- unit tests are tested by node and require tools to be installed (see below)
- unit tests are not currently HTML
- unit tests are held in *_test.js files
node structureWalker_tests.js
If it echoes nothing to the console, it worked.
Options:
Firefox requires firebug plugin
Chrome/Safari include the webkit debugger
node can be debugged on the command line. This is not fun - node-inspector is recommended.
See also: "building Node" and "node-inspector" below.
adding the statement: debugger;
causes debug to break on that line
Type 'help' to get help commands Type 'restart' to reload the js file
Common commands:
- r: run
- c: continue
- n: next
- s: step
- repl: open a javascript console
To evaluate JS
Type 'repl' to go to a js evaluation console. Type ^D to leave the console
Make sure node-inspector is installed (see Building Node and Node modules)
Start the node inspector: node-inspector Start node and tell it to pause at the beginning: node --debug-brk g3.stack_test.js
Open chrome and browse to http://127.0.0.1:8080/
Debug as you would use the webKit debugger.
https://github.com/dannycoates/node-inspector
On windows you can use MINGW - this comes with git for windows and with Rstudio
Install node.js Install compile tools
- windows: visual studio express 2012
other notes in *_test.js
To test, install node.js and the required packages:
npm install underscore
npm install d3
For in-browser debugging: npm install node-inspector
On windows you will need visual studio express installed to build gyp (required by d3).
Running the tests
cd WWW
node structureWalker_tests.js
Some unit tests already exist - run them using node.