From aa91a2fd78825bb83961c76bd1e2ba06fea02347 Mon Sep 17 00:00:00 2001 From: Shane DeWael Date: Wed, 9 Oct 2019 15:45:09 -0700 Subject: [PATCH 1/2] Update logger --- package.json | 2 +- src/ExpressReceiver.spec.ts | 1 + src/test-helpers.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ded83a8ca..c9ece1e3f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "url": "https://github.com/slackapi/bolt/issues" }, "dependencies": { - "@slack/logger": "^1.0.0", + "@slack/logger": ">=1.0.0 <3.0.0", "@slack/types": "^1.0.0", "@slack/web-api": "^5.0.0", "@types/express": "^4.16.1", diff --git a/src/ExpressReceiver.spec.ts b/src/ExpressReceiver.spec.ts index e222218a8..39cf66ceb 100644 --- a/src/ExpressReceiver.spec.ts +++ b/src/ExpressReceiver.spec.ts @@ -15,6 +15,7 @@ describe('ExpressReceiver', () => { warn(..._msg: any[]): void { }, error(..._msg: any[]): void { }, setLevel(_level: LogLevel): void { }, + getLevel(): LogLevel { }, setName(_name: string): void { }, }; diff --git a/src/test-helpers.ts b/src/test-helpers.ts index b8c434ce4..2853617dd 100644 --- a/src/test-helpers.ts +++ b/src/test-helpers.ts @@ -34,6 +34,7 @@ function mergeObjProperties(first: Override, second: Override): Override { export interface FakeLogger extends Logger { setLevel: SinonSpy, ReturnType>; + getLevel: SinonSpy, ReturnType>; setName: SinonSpy, ReturnType>; debug: SinonSpy, ReturnType>; info: SinonSpy, ReturnType>; @@ -46,6 +47,7 @@ export function createFakeLogger(): FakeLogger { // NOTE: the two casts are because of a TypeScript inconsistency with tuple types and any[]. all tuple types // should be assignable to any[], but TypeScript doesn't think so. setLevel: sinon.fake() as SinonSpy, ReturnType>, + getLevel: sinon.fake() as SinonSpy, ReturnType>, setName: sinon.fake() as SinonSpy, ReturnType>, debug: sinon.fake(), info: sinon.fake(), From cc80f123cc02fab5e943b613f29391cf17cedf8d Mon Sep 17 00:00:00 2001 From: Shane DeWael Date: Wed, 9 Oct 2019 15:47:34 -0700 Subject: [PATCH 2/2] Small fix --- src/ExpressReceiver.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExpressReceiver.spec.ts b/src/ExpressReceiver.spec.ts index 39cf66ceb..d062e1ed2 100644 --- a/src/ExpressReceiver.spec.ts +++ b/src/ExpressReceiver.spec.ts @@ -15,7 +15,7 @@ describe('ExpressReceiver', () => { warn(..._msg: any[]): void { }, error(..._msg: any[]): void { }, setLevel(_level: LogLevel): void { }, - getLevel(): LogLevel { }, + getLevel(): LogLevel { return LogLevel.DEBUG; }, setName(_name: string): void { }, };