Closed CezarManea closed 2 years ago
Because of this line of code https://github.com/slackapi/node-slack-sdk/blob/main/packages/web-api/src/WebClient.ts#L216
When you use jest-mock-axios in combination with @slack/web-api you get failed tests with the following error:
jest-mock-axios
@slack/web-api
TypeError: Cannot convert undefined or null to object 6 | 7 | constructor() { > 8 | this.slackClient = new WebClient(Config.slack.token); |
Solution is to add here https://github.com/knee-cola/jest-mock-axios/blob/master/lib/mock-axios.ts#L139
post: {}
Fixed with v4.6.2 / v4.7.0-beta2
v4.6.2
v4.7.0-beta2
Because of this line of code https://github.com/slackapi/node-slack-sdk/blob/main/packages/web-api/src/WebClient.ts#L216
When you use
jest-mock-axios
in combination with@slack/web-api
you get failed tests with the following error:Solution is to add here https://github.com/knee-cola/jest-mock-axios/blob/master/lib/mock-axios.ts#L139