Is there a built in way to spy on existing objects using the test framework?
I've looked at the qunit cookbook and the api docs but that turned up nothing, I might have missed it though.
What I'm looking for is something like PHPUnit mocks, or Jasmine Spies.
var foo = jQuery('#foo');
spyOn(foo, 'setWidth');
// execute function under test
expect(foo.setWidth).toHaveBeenCalledWith(100);
Setting the expectations beforehand like in PHPUnit or mockery would work just as well.
Of course its possible to create that functionality manually, but it would be cool if it would be part of the testing framework since its such a common requirement.