Fixed and refactored the test-helper.js tests.