jshint refactoring for tests