Hi guys - Does Parse Server provide any way to programmatically get a list of the cloud functions registered in the app? The use case here is to make it possible to create automate test that check if each cloud function is covered by a test.
Thanks!
-Marcus
I would recommend:
Install nyc
Creating a package.json
script of "coverage": "nyc jasmine"
(assuming you use jasmine)
Creating a file named .nycrc
on your top level with the contents:
{
"reporter": [
"lcov",
"text-summary"
],
"exclude": [
"**/spec/**"
]
}
Now when you run npm run coverage
on your top level, it will create a coverage
folder with HTML content.
You can then go through one by one and look at the uncovered lines of your code, including your cloud functions.
That’s how I do it anyway.
2 Likes
@Manuel @davimacedo do you think we could include nyc and the coverage script as part of the parse server example project?
Manuel
January 31, 2021, 9:39am
4
I think it makes sense to include that.
dblythy
February 1, 2021, 12:58am
5
Ok thanks Manuel. I’ve opened this PR so now the Parse Server example repo will have:
npm run lint
npm run lint-fix
npm run test
npm run coverage