fixed 'make test' bug

global.location shouldn't be set in the browser,
but should be set in node.js.