Skip to content

Commit e4b24ee

Browse files
committed
Updating ava version and fixing corresponding errs
1 parent bfa56d0 commit e4b24ee

File tree

8 files changed

+1988
-3361
lines changed

8 files changed

+1988
-3361
lines changed

__tests__/embedPermissions.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ test('If there\'s already a permissions field', (t) => {
107107
() => {
108108
embedPermissions(t.context.schema, { permissions: true }, ['manager'], doc);
109109
},
110-
Error,
110+
null,
111111
'An error should be thrown when a permissions key is already present in the target object',
112112
);
113113
});
@@ -118,37 +118,37 @@ test('Verify that the permissions data cannot be changed', (t) => {
118118

119119
t.throws(
120120
() => { doc.permissions = {}; },
121-
Error,
121+
null,
122122
'The permissions object shouldn\'t be writable overall',
123123
);
124124

125125
t.throws(
126126
() => { doc.permissions.read = []; },
127-
Error,
127+
null,
128128
'The permissions object shouldn\'t be writable [read]',
129129
);
130130

131131
t.throws(
132132
() => { doc.permissions.write = []; },
133-
Error,
133+
null,
134134
'The permissions object shouldn\'t be writable [write]',
135135
);
136136

137137
t.throws(
138138
() => { doc.permissions.remove = false; },
139-
Error,
139+
null,
140140
'The permissions object shouldn\'t be writable [remove]',
141141
);
142142

143143
t.throws(
144144
() => { doc.permissions.actions = []; },
145-
Error,
145+
null,
146146
'The permissions object shouldn\'t be writable [actions]',
147147
);
148148

149149
t.throws(
150150
() => { doc.permissions = {}; },
151-
Error,
151+
null,
152152
'The permissions field should not be writable',
153153
);
154154

__tests__/methods/Model.create.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test('Model.create should not be callable with plugin installed', (t) => {
1919

2020
t.throws(
2121
() => MyModel.create({ friend: 'bar' }),
22-
IncompatibleMethodError,
22+
{ instanceOf: IncompatibleMethodError },
2323
);
2424
});
2525

__tests__/methods/Model.remove.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test('Model.remove should not be callable with plugin installed', (t) => {
1919

2020
t.throws(
2121
() => MyModel.remove({ friend: 'bar' }).exec(),
22-
IncompatibleMethodError,
22+
{ instanceOf: IncompatibleMethodError },
2323
);
2424
});
2525

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ module.exports = (schema, installationOptions) => {
8080
}
8181

8282
// TODO handle the overwrite option
83+
// TODO handle Model.updateOne
8384
// TODO handle Model.updateMany
8485

8586
// Detect which fields can be returned if 'new: true' is set

0 commit comments

Comments
 (0)