Files
probot/test/plugins/helper.ts
2018-08-09 23:54:20 -04:00

15 lines
435 B
TypeScript

// FIXME: move this to a test helper that can be used by other apps
import cacheManager from 'cache-manager'
import { Application, ApplicationFunction } from '../../src'
const cache = cacheManager.caching({ store: 'memory', ttl: 0 })
const jwt = jest.fn().mockReturnValue('test')
export function createApp (appFn?: ApplicationFunction) {
const app = new Application({ app: jwt, cache })
appFn && app.load(appFn)
return app
}