Urigo / angular-meteor

Angular and Meteor - The perfect stack

Home Page:https://www.angular-meteor.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building Karma Unit tests for use in app using meteor-client.

Slavrix opened this issue · comments

When building an ionic web app and connecting to meteor via the meteor-client package, How can we write standalone unit tests as import {Meteor} from 'meteor/meteor' does fails with undefined.

If I do declare let Meteor I can get past the import failing, but then the Meteor methods are still unavailable as it isn't imported it seems.

Is there an advised way to mock the default meteor behaviours?

Try using generateNodeModules option for meteor client bundler. This will generate stub modules for Meteor packages, so you’ll have ‘meteor/meteor’ in your node_modules folder.