Throw helpful error if Probot({id, cert}) are not set but `.app` is used, and throw error if `.app` is overwritten
See original GitHub issueFeature Request
Is your feature request related to a problem? Please describe.
This is a follow up for https://github.com/probot/probot/issues/883#issuecomment-473708953
For Probot 7 and below, we would override the .app()
function to return a valid token. Now the .app()
no longer exists. These tests now throw an error
TypeError: this.app.getInstallationAccessToken is not a function
Instead we now have to pass an app id numbers as id
option and a valid private key as cert
option.
Describe the solution you’d like
If the id
and cert
options are not passed, set a getter for probot.app
and throw an error explaining why it is not set.
Besides that, set a setter for probot.app
which throws an error explaining how to mock authentication with Probot 9+
Describe alternatives you’ve considered
¯\_(ツ)_/¯
Teachability, Documentation, Adoption, Migration Strategy
It’s not a user-facing feature, only an improvement of developer experience which should explain itself with helpful error messages
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top GitHub Comments
PRs welcome 😃
this should be resolved with latest Probot