hwillson / meteor-stub-collections

Stub out Meteor collections with in-memory local collections.
MIT License
24 stars 17 forks source link

Meteor - Stub Collections

Intro

Easily stub out Meteor collections with in-memory local collections. The idea here is to allow the use of things like Factories for unit tests and styleguides without having to restrict ourselves to making components "pure". So a component (ie. a template) can still call Widgets.findOne(widgetId), it's just that we will have stubbed out Widgets to point to a local collection that we can completely control in our test.

Installation

meteor add hwillson:stub-collections

Usage via ES6 import

// client or server
import StubCollections from 'meteor/hwillson:stub-collections';

API

Examples

See this packages tests.

History

This project was originally created by MDG, and shipped with the Meteor Guide's todos reference application (thanks MDG!). If you have any questions/comments, open an issue here.

1.0.9 (2018-06-27)

1.0.8 (2018-03-26)

1.0.7 (2018-03-23)

1.0.6 (2017-11-24)

1.0.5 (2017-11-24)

1.0.4 (2017-11-23)

1.0.3

1.0.2

1.0.1