I primarily develop at home on my Windows machine, but all of my web projects live on a Webfaction-hosted linux machine. To create a smooth deployment process with Grunt that will run my tests on either machine I used the PhantomJS node package.
Unit Testing in javascript is usually pretty straightforward. You pick a framework like Jasmine or QUnit, you write some tests, and you run them in your browser or in something headless like PhantomJS.