-
Notifications
You must be signed in to change notification settings - Fork 483
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
Add test to illustrate how to call actions locally #276
base: main
Are you sure you want to change the base?
Conversation
I'd need help on this one - my new test fails with:
|
The test file consuming-services.test.js might be a good place to add this code sample, but it seems to be set up to serve only the |
Full error is
|
Internal ticket is cap/issues#9798 |
Updated the code sample to reflect O.T.'s internal comment on October 4. What did I miss?
|
(Thank you S.!) |
1bccd90
to
7f9980a
Compare
Add the code sample from the capire section [Unbound Actions / Functions](https://cap.cloud.sap/docs/node.js/services#-unbound-actions--functions) as a test in the code sample repository. Signed-off-by: Pierre Fritsch <[email protected]>
9b35a96
to
3928600
Compare
Signed-off-by: Pierre Fritsch <[email protected]>
4d5de47
to
7fcf60b
Compare
Signed-off-by: Pierre Fritsch <[email protected]>
7fcf60b
to
02e1979
Compare
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.
👍 Looks pretty good. Thanks Pierre!
Remark: another valid way to bypass access control in tests is this:
cds.User.default = cds.User.Privileged
e.g. also done here
I like the approach providing the user explicitly as this will actually test the authorizations. |
(Note: I currently don't have write access to this repository, so I cannot merge this PR myself.) |
Add the code sample from the capire section Unbound Actions / Functions as a test in the code sample repository.