Skip to content

Commit 969e43b

Browse files
committed
review changes
1 parent c9f46e8 commit 969e43b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/CloudCode.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3225,9 +3225,15 @@ describe('afterLogin hook', () => {
32253225
await query.find({ context: { a: 'a' } });
32263226
});
32273227

3228-
it('afterFind should have access to context while making fetch call', async () => {
3228+
it('beforeFine and afterFind should have access to context while making fetch call', async () => {
3229+
Parse.Cloud.beforeFind('TestObject', req => {
3230+
expect(req.context.a).toEqual('a');
3231+
expect(req.context.b).to.not.exist;
3232+
req.context.b = 'b';
3233+
});
32293234
Parse.Cloud.afterFind('TestObject', req => {
32303235
expect(req.context.a).toEqual('a');
3236+
expect(req.context.b).toEqual('b');
32313237
});
32323238
const obj = new TestObject();
32333239
await obj.save();

0 commit comments

Comments
 (0)