Testing AngularJS integration into JavaScript code