Adding unit tests for errors.js