-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QUESTION: Usage in monorepo #132
Comments
It should work, this repo itself is a monorepo and uses it successfully. Though admittedly not directly anywhere. From the looks of your code, I don't see anywhere between you clearing the mocks and trying to access an instance of a client where you are creating one. In order to see one in |
Thanks, I'll try that. |
So I updated my code like so:
And I got the same error. Here's the basic code for
As you can see, I'm instantiating |
@kpeters-cbsi Did you find a solution to this? |
I have a monorepo set up using yarn workspaces and Lerna. I've got a package inside the monorepo that sends messages to Slack, and I'd like to test it using this package. The package tests are located under
<repo root>/packages/my-package/tests
, but@slack/web-api
is located under<repo root>/node_modules
. I've tried creating a manual mock as described in the README in both<repo root>/packages/my-package/__mocks__
and<repo root>/__mocks__
, but the below code still gives me an error:TypeError: Cannot read property 'chat' of undefined
. What's the proper way to use this in a monorepo context?Note that I'm using Typescript 4.7.2 and Node 14.19.0
The text was updated successfully, but these errors were encountered: