javascript - karma-sinon-chai fails after moving to Windows -


i have unit tests running under karma, , using sinon-chai library.

everything working fine on mac, have moved windows following error occuring:

c:\users\mchambe4\dev\simple\client>node ./node_modules/gulp/bin/gulp.js unit-tests-dev [16:29:31] using gulpfile ~\dev\simple\client\gulpfile.js [16:29:31] starting 'unit-tests-dev'... [16:29:31] starting karma server... warn [karma]: port 9876 in use info [karma]: karma v0.12.37 server started @ http://localhost:9877/ info [launcher]: starting browser phantomjs info [phantomjs 1.9.8 (windows 7 0.0.0)]: connected on socket fmujwcqrpdmidi3btcyv id 16821903 phantomjs 1.9.8 (windows 7 0.0.0) error   referenceerror: can't find variable: chai   @ c:/users/mchambe4/dev/simple/client/node_modules/karma-sinon-chai/node_modules/sinon-chai/lib/sinon-chai.js:17 

from that file:

if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {     // nodejs     module.exports = sinonchai;  // <---- should go in here } else if (typeof define === "function" && define.amd) {     // amd     define(function () {         return sinonchai;     }); } else {     // other environment (usually <script> tag): plug in global chai instance directly.     chai.use(sinonchai);         // <---- ends here } 

i expect condition on first line return true because running in node, reason neither 'require' or module defined, ends @ point indicated above.

any ideas?

downgrading karma-sinon-chai 1.0.0 0.3.2 fixed problem us. github issue has been filed, assume fixed quickly. https://github.com/kmees/karma-sinon-chai/issues/21

npm install karma-sinon-chai@0.3.2 --save-dev 

Comments