I use mocha to test JavaScript code. The code includes html and css and implements a chat application. As I understand it, Mocha can test JavaScript functions by matching the expected value with the return value of the function.
But what if I want to test functions that do not return a value? Functions that mainly relate to DOM elements. (For example, adding an image).
How exactly can I make fun of the DOM elements in mocha and then check if the functions succeed in generating the corresponding DOM elements?
I looked around and found that this is possible with selenium webdriver and jsdom. Is it possible to run this test only with Mocha and other additional interfaces?
source
share