I\'m creating a js widget and first part is to add script width javascript, something like this (example from google analytics):
(function() {
var ga = d
For setting up HTML fixtures in my specs, I wrote jasmine-fixture. With it, you can do stuff like this:
var $foo, $input;
beforeEach(function(){
$foo = affix('.foo');
# appends to the DOM
$input = $foo.affix('input[id="name"][value="Jim"]');
# appends beneath the .foo div
And afterEach, it'll clean up after you.
For expectations about the state of the DOM, I use jasmine-jquery. It offers a ton of matchers like the one below:
it('is named Jim', function(){
expect($input).toHaveValue("Jim");
});