Meteor package unit test with using database


#1

Hi everyone
I has got a problem.
I try to create unit test for meteor package with using database.

For this reasons in official guide recommended to use Factory from dburles:factory package.

I add it to my packages dependency

Package.onTest((api) => {
  api.use('ecmascript');
  api.use('practicalmeteor:chai');
  api.use('dburles:factory');

and import it to my test file

import { Factory } from 'meteor/dburles:factory';

than I try to use it:


describe('UserUtils getProfilePicture function test ', () => {
  it('get profile picture from profile.image field', () => {
    let users2 = new Mongo.Collection('users');
    Factory.define('userFactory', users2, { name: 'Test user' });
  });
});

but I has got only error message in my test

Error: Factory.define is not a function

If anybody know, please help me. What i do wrong?