Skip to content

Commit

Permalink
disable throttling and retry logic in octokit
Browse files Browse the repository at this point in the history
  • Loading branch information
jetersen authored and dependabot-preview[bot] committed Dec 26, 2020
1 parent c2d2351 commit 86f1d9d
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const nock = require('nock')
const route = require('nock-knock/lib').default
const { Probot, Octokit } = require('probot')
const { Probot, ProbotOctokit } = require('probot')
const getConfigMock = require('./helpers/config-mock')
const releaseDrafter = require('../index')
const mockedEnv = require('mocked-env')
Expand Down Expand Up @@ -30,22 +30,26 @@ describe('release-drafter', () => {
let logger
let restoreEnv

const streamLogsToOutput = new Stream.Writable({ objectMode: true })
streamLogsToOutput._write = (object, encoding, done) => {
logger.push(JSON.parse(object))
done()
}

probot = new Probot({
appId: 179208,
privateKey,
githubToken: 'test',
Octokit: ProbotOctokit.defaults({
retry: { enabled: false },
throttle: { enabled: false },
}),
log: pino(streamLogsToOutput),
})
probot.load(releaseDrafter)

beforeEach(() => {
logger = []
const streamLogsToOutput = new Stream.Writable({ objectMode: true })
streamLogsToOutput._write = (object, encoding, done) => {
logger.push(JSON.parse(object))
done()
}

probot = new Probot({
appId: 179208,
privateKey,
githubToken: 'test',
Octokit,
log: pino(streamLogsToOutput),
})
probot.load(releaseDrafter)

nock('https://api.github.com')
.post('/app/installations/179208/access_tokens')
Expand Down

0 comments on commit 86f1d9d

Please sign in to comment.