Skip to content

Instantly share code, notes, and snippets.

@gmurphey
Created July 20, 2012 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmurphey/3151540 to your computer and use it in GitHub Desktop.
Save gmurphey/3151540 to your computer and use it in GitHub Desktop.
Spy Tests
var Windows = {
method1: function () { }
};
(function ($) {
module('windows-api', {
setup: function () {
sinon.spy(Windows, 'method1');
},
teardown: function () {
Windows.method1.restore();
}
});
test('do something on our end that uses the Windows API', function () {
// do something with the Windows API
sinon.assert.calledOnce(Windows.method1);
});
}) (jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment