-
-
Notifications
You must be signed in to change notification settings - Fork 598
Handle undefined in Cloud Code #682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,18 @@ describe('CloudController', () => { | |
}); | ||
}); | ||
|
||
it('run undefined response', (done) => { | ||
const request = jest.fn(); | ||
request.mockReturnValue(Promise.resolve(undefined)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can probably remove the whole test then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I change it, need for unit test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the test should stay the same. Returning an object with unknown key should not be valid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see what you mean |
||
|
||
const ajax = jest.fn(); | ||
CoreManager.setRESTController({ request: request, ajax: ajax }); | ||
|
||
Cloud.run('myfunction').then(() => { | ||
done(); | ||
}); | ||
}); | ||
|
||
it('startJob passes encoded requests', () => { | ||
Cloud.startJob('myJob', { value: 12, when: new Date(Date.UTC(2015,0,1)) }); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should still throw an error if there was a .result before but not after decoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think that would ever happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok then!