Skip to content

Factory.define is not working! #36

@IanChok

Description

@IanChok
if (Meteor.isServer) {
  describe('Workspaces Methods', function () {
    Factory.define('workspace', CollectionWorkSpaces, {
      owner: () => 'ABC',
      participant_ids: () => ['123'],
      invitee_emails: () => []
    });

    beforeEach(function () {
      resetDatabase();
    });

    it('updates invitee email list', function () {
      const document1 = Factory.create('workspace');
      console.log(document1); 
    })
  });
}
//output of document1
{
  _id: '7Qc9PTQpxCesqZS5k',
  owner: '3a6rW9QqnoTpMctCd',
  participant_ids: [],
  invitee_emails: []
}

//expected output:
{
  _id: '7Qc9PTQpxCesqZS5k',
  owner: 'ABC',
  participant_ids: ['123'],
  invitee_emails: []
}

Meteor version 2.5
dburles:factory version 1.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions