arunoda / laika

testing framework for meteor
http://arunoda.github.io/laika/
MIT License
242 stars 38 forks source link

Using npm modules #119

Open aramk opened 10 years ago

aramk commented 10 years ago

Is there an easy way to use npm modules within tests? https://github.com/zvictor/laika-extended-example/blob/master/tests/%24setup.js uses should by installing it globally, but the https://www.npmjs.org/doc/faq.html says this shouldn't be used for require().

I'm trying to mock objects with Sinon.JS but installing it globally doesn't add the dependency with require(), so I tried using Npm.depends() but that didn't work at all with Meteor 0.8, and using Meteor.require() with meteor-npm only has Meteor defined within test().