import GitHubAPI from "../../../src/config/github-api" ; import enhanceOctokit from "../../../src/config/enhance-octokit" ; describe ( "enhanceOctokit" , ( ) => { describe . skip ( "request metrics" , ( ) => { let octokit ; beforeEach ( async ( ) => { octokit = GitHubAPI ( ) ; enhanceOctokit ( octokit ) ; } ) ; describe ( "when successful" , ( ) => { beforeEach ( ( ) => { githubNock . get ( "/events" ) . reply ( 200 , [ ] ) ; } ) ; it ( "sends reqest timing" , async ( ) => { await expect ( await octokit . activity . listPublicEvents ( ) ) . toHaveBeenCalled ( ) ; } ) ; it ( "logs request timing" , async ( ) => { await octokit . activity . listPublicEvents ( ) ; } ) ; } ) ; describe ( "when fails" , ( ) => { beforeEach ( ( ) => { githubNock . get ( "/events" ) . reply ( 500 , [ ] ) ; } ) ; it ( "sends request timing" , async ( ) => { await expect ( await octokit . activity . listPublicEvents ( ) . catch ( jest . fn ( ) ) ) . toHaveBeenCalled ( ) ; } ) ; it ( "logs request timing" , async ( ) => { await octokit . activity . listPublicEvents ( ) . catch ( jest . fn ( ) ) ; } ) ; } ) ; } ) ; } ) ;