Search code examples
xmlhttprequestphantomjscasperjssinonslimerjs

Sinon with PhantomXHR - Window.sinon is undefined


I am using CasperJS along with PhantomXHR. When I run the code in webkit version I can able to mock the response but the same script is not working in Firefox using --engine= slimerjs. It launches the Firefox browser and shows the Page error as window.sinon is undefined. Any solution to get rid of this issue. Are PhantomXHR + sinon will support with slimerjs?


Solution

  • After so much struggle i have found that gloabl variable assigned to window is causing the issue.Just use sinon instead of window.sinon in phantomxhr