I implemented NightWatch for (Behavior driven) testing a couple of websites. All of them are backend driven (Java, JSP).
Now some of the employees say its the wrong choice, and it should be a unit test framework.
But the front-end doesn't have any 'units', it simply reacts on the HTML present on the page, and binds some plugins / Vanilla JS Class to it.
Am I wrong, that unit testing would be simple impossible for the front-end, as there are (almost) no functions that simply return a value. They are all bound on page-load to an HTML element.
For example:
<div data-components="myComponent"><div>inner</div></div>
Loads some JavaScript (myComponent), that will alter/add/remove some HTML from the page. It does not 'return' anything. It updates the page.
All advice is more than welcome.