forked from mirrors/probot
Remove deprecated `robot` method from a probot instance
This commit is contained in:
parent
c030b5f685
commit
dc33e4be6f
8
index.js
8
index.js
|
@ -71,14 +71,6 @@ module.exports = (options = {}) => {
|
|||
receive,
|
||||
logger,
|
||||
|
||||
// Return the first robot
|
||||
get robot () {
|
||||
const caller = (new Error()).stack.split('\n')[2]
|
||||
console.warn('DEPRECATED: the `robot` property is deprecated and will be removed in 0.10.0')
|
||||
console.warn(caller)
|
||||
return robots[0] || createRobot({app, cache, logger, catchErrors: true})
|
||||
},
|
||||
|
||||
start () {
|
||||
server.listen(options.port)
|
||||
logger.trace('Listening on http://localhost:' + options.port)
|
||||
|
|
|
@ -107,24 +107,6 @@ describe('Probot', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('robot', () => {
|
||||
it('will be removed in 0.10', () => {
|
||||
// This test will fail in version 0.10
|
||||
const semver = require('semver')
|
||||
const pkg = require('../package')
|
||||
expect(semver.satisfies(pkg.version, '<0.10')).toBe(true)
|
||||
})
|
||||
|
||||
it('returns the first defined (for now)', () => {
|
||||
const robot = probot.load(() => { })
|
||||
expect(probot.robot).toBe(robot)
|
||||
})
|
||||
|
||||
it('returns a robot if no plugins are loaded', () => {
|
||||
expect(probot.robot).toExist()
|
||||
})
|
||||
})
|
||||
|
||||
describe('sentry', () => {
|
||||
afterEach(() => {
|
||||
// Clean up env variables
|
||||
|
|
Loading…
Reference in New Issue