Skip to content

Commit

Permalink
Updating ava version and fixing corresponding errs
Browse files Browse the repository at this point in the history
  • Loading branch information
makinde committed Aug 14, 2020
1 parent bfa56d0 commit e4b24ee
Show file tree
Hide file tree
Showing 8 changed files with 1,988 additions and 3,361 deletions.
14 changes: 7 additions & 7 deletions __tests__/embedPermissions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ test('If there\'s already a permissions field', (t) => {
() => {
embedPermissions(t.context.schema, { permissions: true }, ['manager'], doc);
},
Error,
null,
'An error should be thrown when a permissions key is already present in the target object',
);
});
Expand All @@ -118,37 +118,37 @@ test('Verify that the permissions data cannot be changed', (t) => {

t.throws(
() => { doc.permissions = {}; },
Error,
null,
'The permissions object shouldn\'t be writable overall',
);

t.throws(
() => { doc.permissions.read = []; },
Error,
null,
'The permissions object shouldn\'t be writable [read]',
);

t.throws(
() => { doc.permissions.write = []; },
Error,
null,
'The permissions object shouldn\'t be writable [write]',
);

t.throws(
() => { doc.permissions.remove = false; },
Error,
null,
'The permissions object shouldn\'t be writable [remove]',
);

t.throws(
() => { doc.permissions.actions = []; },
Error,
null,
'The permissions object shouldn\'t be writable [actions]',
);

t.throws(
() => { doc.permissions = {}; },
Error,
null,
'The permissions field should not be writable',
);

Expand Down
2 changes: 1 addition & 1 deletion __tests__/methods/Model.create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('Model.create should not be callable with plugin installed', (t) => {

t.throws(
() => MyModel.create({ friend: 'bar' }),
IncompatibleMethodError,
{ instanceOf: IncompatibleMethodError },
);
});

Expand Down
2 changes: 1 addition & 1 deletion __tests__/methods/Model.remove.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('Model.remove should not be callable with plugin installed', (t) => {

t.throws(
() => MyModel.remove({ friend: 'bar' }).exec(),
IncompatibleMethodError,
{ instanceOf: IncompatibleMethodError },
);
});

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module.exports = (schema, installationOptions) => {
}

// TODO handle the overwrite option
// TODO handle Model.updateOne
// TODO handle Model.updateMany

// Detect which fields can be returned if 'new: true' is set
Expand Down
Loading

0 comments on commit e4b24ee

Please sign in to comment.