learn how to test specific modules
Could you tell me more about this -- what is the best method and tool for unit testing in JavaScript? In Java I use JUnit for the non-GUI parts, and the GUI parts I simply don't test... perhaps I should test them too, but in my programs most of complexity is in the non-GUI parts, so if I test them, most of the work is covered.
JavaScript feels more integrated with the GUI (the browser). In theory, it is an independent language, which can be embedded in browser or in anything else, and all the browser stuff is just like an additional library. When I will write more complex JavaScript programs, I want to write them in the way that separates the program logic from the browser API. And I would want to unit-test the logic. Shortly: I would like to unit-test JavaScript code in a JUnit style, not in a "browser emulation" style. What would be the best approach to do that? Also with regards to browser emulation or integration, which are the best tools? I have tried some (Canoo WebTest, Selenium), and they seem rather inelegant when compared with JUnit testing. Although Selenium also has a programming mode that seems more friendly; I haven't tried it yet. I would appreciate some help here, so I don't have to study and experiment with dozen tools.
especially for javascript, I cannot stress enough the value of having even a basic reversion control system of "copying the folder and renaming it after each major stable milestone".
Yep, this is my blind spot. I know I should do it, I don't do it, and I often run into problems that this would prevent. I'll try to remember to install Subversion at home. Thanks for reminding me about this!
Regarding unit testing JavaScript, I recently asked this question myself at Stack Overflow (and if you're not familiar with Stack Overflow and the Stack Exchange Network, I recommend you should; it is a great place to get answers for technical problems), and ended up using Jasmine. I'm skeptical of the “BDD” thing, but it seems a perfectly fine tool for unit testing. I'm using it (example) to test logic inside the browser — that is, I load a web page which runs the tests and becomes the report of results — but I understand it can also be used from a “headl...
This is the bimonthly 'What are you working On?' thread. Previous threads are here. So here's the question:
What are you working on?
Here are some guidelines: