jsUnity
I was looking for a lightwieght, context-agnostic testing framework for JavaScript so I could describe the behavior of whatever script I was writing (and found one, thanks to Ates making it.) The particular script I was working on had no need for a browser or any of the extra environmental cruft - it was pure JavaScript, ready to be plugged in wherever it may go. Or perhaps it will never leave the comfort of a Spidermonkey shell, the point is I just wanted a quick run-down of what it should do, and not have to launch a browser just to see.
JavaScript decoupled from HTML? It is rare indeed. Even with server-side JavaScript you could still be dealing with a document.
Enter jsUnity (nice pun, by the way,) which lets you plug your test suite into any environment. You just supply a custom jsUnity.log function for logging to that environment.
jsUnity.log = function (s) { document.write(s + "</br>"); };
This rubs me the right way. This concept could be extended to allow other customizations for specific environments. The core test suite can stay light while modules are built around it.
The globally scoped assertions kind of bug me, but seem to be modeled after JsUnit style tests. Ideally, those assertions could reside in a module, making them as easy to use and safe to extend.
It’s a start, a nod in the right direction. Plus, there’s always github for forking.
Hey, JavaScript and HTML are a couple for now, but the way HTML has been flirting around, you never know… JavaScript needs to keep it’s figure right and assets in order - mmhm.