mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-15 10:27:43 +08:00
* Add /probot route with tests * Add index route, write tests * Remove unused arg * Pass tests * Tweak HTML string and pkg require * Add static directory * Design welcome page * Rename to probot.html * Implement EJS * Remove duplicate load * Extract default homepage into plugin * Fix issue after merge conflict * Refactor app loading * Remove autoloading of plugings BREAKING CHANGE: `probot run` without any arguments will no longer autoload apps named `probot-*`. * Move setup * Look for `apps` key instead of `plugins` * Update simulate command * Simplify resolver * Remove unused routes variable * Move views to default path * Call probot.setup to properly initialize default apps * Simplify package loading * Specify extension * Add links to docs/slack * Remove stats link * Add helper to jest ignore * Fix ejs views error * Move a require to top of file * Remove unnecessary (and breaking) test
28 lines
521 B
JavaScript
28 lines
521 B
JavaScript
// FIXME: move this to a test helper that can be used by other apps
|
|
|
|
const cacheManager = require('cache-manager')
|
|
const GitHubApi = require('github')
|
|
const {createRobot} = require('../..')
|
|
|
|
const cache = cacheManager.caching({store: 'memory'})
|
|
|
|
const app = {
|
|
async asApp () {
|
|
return new GitHubApi()
|
|
},
|
|
|
|
async asInstallation () {
|
|
return new GitHubApi()
|
|
},
|
|
|
|
async createToken () {
|
|
return {data: {token: 'test'}}
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
createRobot () {
|
|
return createRobot({app, cache})
|
|
}
|
|
}
|