IBM / slack-wrench

Tools to build and test Slack apps
Apache License 2.0
48 stars 26 forks source link

App won't compile because of typing errors - TypeScript #127

Closed AlexisTonneau closed 2 years ago

AlexisTonneau commented 2 years ago

Describe the bug App won't compile because of typing errors with TypeScript.

Steps to reproduce Create Bolt app with latest versions and copy paste the example of the documentation of jest-bolt-receiver.

Logging output:

node_modules/@slack-wrench/jest-mock-web-client/lib/index.d.ts:19:14 - error TS2416: Property 'admin' in type 'MockWebClient' is not assignable to the same property in base type 'Partial<WebClient>'.
  Type '{ apps: { approve: Mock<any, any>; approved: { list: Mock<any, any>; }; requests: { list: Mock<any, any>; }; restrict: Mock<any, any>; restricted: { list: Mock<any, any>; }; }; ... 4 more ...; users: { ...; }; }' is missing the following properties from type '{ apps: { approve: Method<AdminAppsApproveArguments, AdminAppsApproveResponse>; approved: { list: Method<AdminAppsApprovedListArguments, AdminAppsApprovedListResponse>; }; ... 4 more ...; uninstall: Method<...>; }; ... 7 more ...; users: { ...; }; }': auth, barriers, emoji

19     readonly admin: {
                ~~~~~

node_modules/@slack-wrench/jest-mock-web-client/lib/index.d.ts:99:14 - error TS2416: Property 'auth' in type 'MockWebClient' is not assignable to the same property in base type 'Partial<WebClient>'.
  Property 'teams' is missing in type '{ revoke: Mock<any, any>; test: Mock<any, any>; }' but required in type '{ revoke: Method<AuthRevokeArguments, AuthRevokeResponse>; teams: { list: Method<AuthTeamsListArguments, AuthTeamsListResponse>; }; test: Method<...>; }'.

99     readonly auth: {
                ~~~~

  node_modules/@slack/web-api/dist/methods.d.ts:148:9
    148         teams: {
                ~~~~~
    'teams' is declared here.

node_modules/@slack-wrench/jest-mock-web-client/lib/index.d.ts:162:14 - error TS2416: Property 'conversations' in type 'MockWebClient' is not assignable to the same property in base type 'Partial<WebClient>'.
  Type '{ archive: Mock<any, any>; close: Mock<any, any>; create: Mock<any, any>; history: Mock<any, any>; info: Mock<any, any>; invite: Mock<any, any>; ... 11 more ...; unarchive: Mock<...>; }' is missing the following properties from type '{ acceptSharedInvite: Method<ConversationsAcceptSharedInviteArguments, ConversationsAcceptSharedInviteResponse>; ... 21 more ...; unarchive: Method<...>; }': acceptSharedInvite, approveSharedInvite, declineSharedInvite, inviteShared, listConnectInvites

162     readonly conversations: {
                 ~~~~~~~~~~~~~

node_modules/@slack-wrench/jest-mock-web-client/lib/index.d.ts:287:14 - error TS2416: Property 'oauth' in type 'MockWebClient' is not assignable to the same property in base type 'Partial<WebClient>'.
  Type '{ access: Mock<any, any>; v2: { access: Mock<any, any>; }; }' is not assignable to type '{ access: Method<OAuthAccessArguments, OauthAccessResponse>; v2: { access: Method<OAuthV2AccessArguments, OauthV2AccessResponse>; exchange: Method<...>; }; }'.
    Types of property 'v2' are incompatible.
      Property 'exchange' is missing in type '{ access: Mock<any, any>; }' but required in type '{ access: Method<OAuthV2AccessArguments, OauthV2AccessResponse>; exchange: Method<OAuthV2ExchangeArguments, OauthV2ExchangeResponse>; }'.

287     readonly oauth: {
                 ~~~~~

  node_modules/@slack/web-api/dist/methods.d.ts:244:13
    244             exchange: Method<OAuthV2ExchangeArguments, OauthV2ExchangeResponse>;
                    ~~~~~~~~
    'exchange' is declared here.

node_modules/@slack-wrench/jest-mock-web-client/lib/index.d.ts:346:14 - error TS2416: Property 'team' in type 'MockWebClient' is not assignable to the same property in base type 'Partial<WebClient>'.
  Type '{ accessLogs: Mock<any, any>; billableInfo: Mock<any, any>; info: Mock<any, any>; integrationLogs: Mock<any, any>; profile: { get: Mock<any, any>; }; }' is missing the following properties from type '{ accessLogs: Method<TeamAccessLogsArguments, TeamAccessLogsResponse>; billableInfo: Method<TeamBillableInfoArguments, TeamBillableInfoResponse>; ... 4 more ...; profile: { ...; }; }': billing, preferences

346     readonly team: {
                 ~~~~
barlock commented 2 years ago

This should be fixed by #123 published in 1.4.0 just now. Try upgrading and see if that resolves the issue.

AlexisTonneau commented 2 years ago

Thanks, all good!