unit testing for javascript function checking header