Hacker News new | ask | show | jobs
by nicolasiac 3735 days ago
Can anyone explain how should I go about writing unit tests for JavaScript? The code mostly creates the ui (i.e. create button and input controls dynamically) and then displays and updates data. We thought about using intern but I don't really know what should the tests be about. The backend is already test driven so I don't have to test that the data is actually saved.
1 comments

How about this: https://facebook.github.io/jest/

It lets you run your tests on node.js, so your test runner does not have to start a browser etc.