Following on from my original post of learning how to put JavaScript together it’s been a really productive week. Have I managed to write JavaScript that’s easy to test? No, but I’ve wrapped up some reasonably complex logic into a component that can have some of its functionality tested! At the moment I’ve settled on QUnit as my JS unit testing framework and have a couple of tests verifying the default values of exposed properties . . .
If you’re using WIX and you’re adding components to the product file by hand then you’ve probably found yourself creating and cutting/pasting a lot of GUIDs which can be a real pain and productivity killer. There is the “Create GUID” menu option under tools but that still requires calling and then cutting / pasting. The other day one of the other members on our team came up with these steps to create a macro that . . .
After many years of trial and error / practise I feel fairly happy that I can write clean, testable .NET / C# code, which is free of any external dependencies which traditionally make unit testing harder. It’s fair to say that I’m a convert to TDD; having implemented it on two separate commercial projects and seen the benefits of the improved maintainability of the codebase over time. But what about Javascript? Thanks to Selenium and . . .