Tests stall when calling `context.config`
See original GitHub issueBug Report
Current Behavior
I’m trying to upgrade from Probot 7 to 9 but my jest tests stall when the app calls context.config
, for example:
const config = await context.config('issue-branch.yml', {})
I have different tests that check if the app works with and without configs in the target repo. For example, to check if the app works without configuration I mock the network call like this:
nock('https://api.github.com')
.get('/repos/robvanderleek/create-issue-branch/contents/.github/issue-branch.yml')
.reply(404)
With Probot 7 this works fine but after upgrading to 9 the test stalls and I eventually receive a Jest timeout (Timeout - Async callback was not invoked within the 15000ms timeout specified by jest.setTimeout.
)
Expected behavior/code
A call to await context.config('issue-branch.yml', {})
should result in a network call that I can mock.
Perhaps I’m misunderstanding how this work in version 9 so I’m not sure this is a bug or expected behaviour.
Environment
- Probot version(s): 9.6.3
- Node/npm version: 12.12.0
- OS: macOS
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (5 by maintainers)
Top GitHub Comments
This is so weird… I can see in the
recent-probot-and-nock-versions
branch that the bug is not reproducible… but I still have the same problem using the exact same versions of probot, nock and jest 😕Thanks for the repo!
Nvm I just figured out: