refactor testcase to pass jslint check