Published on September 01, 2012 by Toran Billups
To install jasmine-node you will first need to have a recent version of node installed (assuming you want to run these tests on your local developer machines that is).
For anyone running OSX I'd recommend using brew because it works and it's low friction.
For anyone running Ubuntu I'd just pull down my chef recipe for developer machines and run the installer. This recipe could also be used on your ci server if you want to run these tests with each checkin (jenkins support is a cake walk because it's a simple command line utility).
Now that you have node installed you will need to install the jasmine-node package using npm. In the past I would have installed this globally but it's usually not a good idea to install anything globally. Instead we will keep this in your local directory to isolate yourself from the global node /npm code on the system.
npm install jasmine-node
If the above fails you might need to run it as sudo depending on how you installed node + npm on your system. After the install is complete you will notice a directory called node_modules was added to your project (add this to the .gitignore as it shouldn't be added to source control in any way).
If you are working on a team like I am you will want to checkin a simple file called 'packages.json' that looks like the below. That way other developers who don't yet have jasmine-node installed can just pull down the repository and do 'npm install'
Because the jasmine-node test runner actually lives inside the node_modules folder we installed earlier with npm, we can either point to it or create a symlink to run it shorthand (I prefer the symlink myself).
sudo ln -sf ~/projects/yourapphere/node_modules/jasmine-node/bin/jasmine-node /usr/local/bin/jasmine-node