fix: `createProbot() without options

This commit is contained in:
Gregor Martynus 2020-12-07 13:54:27 -08:00
parent d315f0c2b6
commit 8c01e90ecc
2 changed files with 6 additions and 1 deletions

View File

@ -33,7 +33,7 @@ const DEFAULTS = {
* @param overrides overwrites defaults and according environment variables
* @param env defaults to process.env
*/
export function createProbot(options: Options | CreateProbotOptions) {
export function createProbot(options: Options | CreateProbotOptions = {}) {
if (isDeprecated(options)) {
return deprecatedCreateProbot(options);
}

View File

@ -48,6 +48,11 @@ describe("Deprecations", () => {
);
});
it("createProbot() without options", () => {
const probot = createProbot();
expect(probot).toBeInstanceOf(Probot);
});
it("probot.webhook", () => {
const probot = new Probot({ log: pino(streamLogsToOutput) });
expect(probot).toBeInstanceOf(Probot);