mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-15 02:18:58 +08:00
16 lines
435 B
TypeScript
16 lines
435 B
TypeScript
// FIXME: move this to a test helper that can be used by other apps
|
|
|
|
import { Application, ApplicationFunction, GitHubApp } from '../../src'
|
|
|
|
export function newApp (): Application {
|
|
const adapter = new GitHubApp(1, 'test')
|
|
adapter.jwt = jest.fn().mockReturnValue('test')
|
|
return new Application({ adapter })
|
|
}
|
|
|
|
export function createApp (appFn?: ApplicationFunction) {
|
|
const app = newApp()
|
|
appFn && appFn(app)
|
|
return app
|
|
}
|