How far can you go for JavaScript testing?

I am a little informed with TDD and BDD with Ruby / Rails, but I will eventually need to use some form of testing with my JavaScript code. I use MooTools as a JS framework, and I absolutely love how well I can organize and modulate my code with its code base. But sometimes, when I add new features to my application, I find that functionality can easily break down from how it worked before.

When it comes to testing JavaScrtpt code, is testing itself out of line with user interaction? Is this really only for checking the inputs and outputs of methods and (emulated) classes in JavaScript? Or is there a UX testing practice where you can write unit tests to find out if the behavior of your UX application works, how should it be? I know that “behavior” is a broad term, but it’s all the same that you can organize your JavaScript tests so that whenever you add something new you can rest (somewhat) calmly so that your new code doesn’t not broke with? How is this done with any of the larger web applications?

+3
source share
1 answer

It is completely normal, accepted and recommended to use unit testing modules such as JSSpec or Jasmine (there are many others).

Then you can make a UI module, a functional and sometimes even an integration test using tools such as Ghostbuster or Selenium . This allows you to fake custom events and interactions.

Ghostbuster is still quite young, so we don’t know much about “real” needs, but Selenium is an industry standard (I know that it is used by IBM, source: teacher working at IBM).

, , UX. UX User eXperience, , , .

+4

All Articles