Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Allow setting the model later (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Jan 19, 2017
1 parent 3ebdf65 commit 37e7467
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class Service {
throw new Error('MongoDB options have to be provided');
}

if (!options.Model) {
throw new Error('MongoDB collection `Model` needs to be provided');
}

this.Model = options.Model;
this.id = options.id || '_id';
this.events = options.events || [];
Expand Down
6 changes: 0 additions & 6 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ describe('Feathers MongoDB Service', () => {
);
});

describe('when missing a Model', () => {
it('throws an error', () =>
expect(service.bind(null, {})).to.throw('MongoDB collection `Model` needs to be provided')
);
});

describe('when missing the id option', () => {
it('sets the default to be _id', () =>
expect(service({ Model: db }).id).to.equal('_id')
Expand Down

0 comments on commit 37e7467

Please sign in to comment.