How to write Testcase with Mocha + Chai

Viewed 32

I have jQuery code for keyboard navigation, I need to write testcase using Mocha and Chai. This testcase can be executed when Esc key is pressed:

  onEscapeClosePopup: function (e) {
    if (e.keyCode === 27) {
      $('.close-button span').trigger('click');
    }
  }
0 Answers
Related