nathanboktae / mocha-casperjs

Write CasperJS tests using Mocha
MIT License
120 stars 30 forks source link

extended hack for #40 to work with win server 2008 #63

Closed sspringer82 closed 9 years ago

sspringer82 commented 9 years ago

Hi there,

on Win Server 2008 we get an object instead of a function for casper.fetchText. The attached commit solved the problem for us (just extended the already existing hack). Would be nice if you can integrate it.

Best Regards

Sebastian

nathanboktae commented 9 years ago

this will break the previous hack as indexOf('function') is 0 which is falsy.

if (typeof casper.__proto__.fetchText.toString === 'function' && casper.__proto__.fetchText.toString().indexOf('fetchText') === -1)