{"id":1151,"date":"2013-06-12T08:51:36","date_gmt":"2013-06-12T14:51:36","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=1151"},"modified":"2013-06-12T08:51:36","modified_gmt":"2013-06-12T14:51:36","slug":"older-versions-of-sinon-js-dont-work-with-jquery-2-0","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/1151","title":{"rendered":"Older versions of Sinon.js don&#8217;t work with jquery 2.0"},"content":{"rendered":"<p>This is a quick hit, hopefully to help someone avoid spending the half day I just did.<\/p>\n<p>The older versions <a href=\"http:\/\/sinonjs.org\/\">of sinon.js<\/a>, a helpful javascript testing tool which lets you mock up and stub out objects, <a href=\"https:\/\/github.com\/cjohansen\/Sinon.JS\/issues\/271\">do not work with jquery 2.0<\/a>.\u00a0 Even though 2.0 is API compatible with the 1.x series, apparently some different stuff happens under the covers.\u00a0 This is an issue for me because a few months ago, I followed <a href=\"http:\/\/addyosmani.com\/blog\/unit-testing-backbone-js-apps-with-qunit-and-sinonjs\/\">these instructions to set up our testing infrastructure<\/a>, and used sinon.js version 1.4.2.\u00a0 That worked fine with jquery 1.8.2, but when I upgraded everything, tests where I mocked up server calls failed&#8211;the backbone model&#8217;s parse method was never called.<\/p>\n<p>The answer?\u00a0 Use at least version 1.7.1 of sinon.js.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick hit, hopefully to help someone avoid spending the half day I just did. The older versions of sinon.js, a helpful javascript testing tool which lets you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,54,58],"tags":[],"class_list":["post-1151","post","type-post","status-publish","format-standard","hentry","category-dynamic-languages","category-javascript","category-testing"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1151"}],"version-history":[{"count":1,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1151\/revisions"}],"predecessor-version":[{"id":1152,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1151\/revisions\/1152"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}