Meteor NPM Package Test Dependencies
Load npm dependencies in your package-tests.
Just add this package to your Package.onTest
list of packages and load the NPM packages your Meteor package requires.
Now you don't need to wrap your packages into a Meteor project for integration testing anymore :-)
Usage
- Add this package to your tests:
1Package.onTest(function (api) { 2 // ... 3 api.use('jkuester:npm') 4 // ... 5})
- Load the npm packages that your package requires in your tests:
package-tests.js
1import { NpmLoader } from 'meteor/jkuester:npm' 2 3NpmLoader.load(['lodash@latest'], (err /*, data */) => { 4 if (err) { 5 throw err 6 } 7})
LICENSE
MIT