lundi 31 août 2015

How do I make use of libraries in my Ember unit tests?

I'm trying to make use of a library (chance.js) in my Ember unit tests, but I can't seem to import it in my tests.

So far I've tried using NPM (with and without ember-browserify), Bower (played around with trying the app.import calls in ember-cli-build.js.

No matter what I do, I can't seem to be able to access the chance functions/module.

Any help would be greatly appreciate. Top marks would go to anyone who can point me to an Ember project which is using chance.js in their unit tests.

If possible in your answer, a brief explanation of which dependency management is appropriate would be very helpful. From what I've read, it seems NPM might be the go-to as the Ember project is looking to move away from Bower, see here.

Also, if anyone knows of any helpful articles (up-to-date would also be a plus), feel free to mention them in comments.

Thanks!




Aucun commentaire:

Enregistrer un commentaire