Assuming you're testing javascript that is intended to run in node (javascript with require()s in it), you should run the tests in node, not the browser. That said, it's possible to "browserify" your node javascript to get it to run in the browser, but it's better and simpler to test node javascript in node itself.
Some of the most popular browser-based test frameworks (qunit & jasmine) have node-based runners (jasmine-node and node-qunit). Or you could use a test framework that is more node-focused (like mocha or vows).
If you're writing cross-platform code that needs to run both in node and in the browser, you should run the tests in both environments to verify that both work as expected (personally I write mocha tests and use both their html reporter (browser) and their default "Dot Matrix" reporter (node)).
Aside: if you're interested in writing code that runs in both the browser and node, you can use browserify, which a lot of the people on this list use, or you can use a little boilerplate in your libraries (as the backbone & underscore libraries do) -- I wrote a little bit about this here:
http://csnw.github.io/2013/06/23/this-in-node-modules-and-iifes.html.