add tests for server utils

This adds tests for `server/utils.js` which was completely untested.