@edemaine/meteor-tracker
Meteor Tracker is a dependency
tracking system from Meteor.
This NPM package @edemaine/meteor-tracker
offers a drop-in replacement for
the meteor/tracker
module available in Meteor
(with the tracker
package),
so that it can be used in other JavaScript projects,
in particular for testing NPM packages that are intended for Meteor
but testing from outside Meteor (e.g. via Jest).
The code consists of a one-line change to
Meteor's source code,
to make the Node module exports match the Meteor exports
(Tracker
and Deps
).
Versions
The intent is to track the latest version of Meteor Tracker.
If the latter changes, please open an issue to update this package.
NPM version | Meteor Tracker version |
---|
1.0.x | 1.2.0 |
Usage: JavaScript
To install:
npm install meteor-tracker
In your JavaScript code, you can use:
import {Tracker} from '@edemaine/meteor-tracker';
Usage: Jest
To install:
npm install --save-dev meteor-tracker
To use this module for testing in Jest as a substitute for meteor/tracker
,
add the following to your Jest configuration:
moduleNameMapper: {
'^meteor/tracker$': '@edemaine/meteor-tracker',
},