-
Notifications
You must be signed in to change notification settings - Fork 357
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
chore: remove from aptos blockchain from families #8897
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
3 Skipped Deployments
|
let mockedAptos; | ||
let mockedApolloClient; | ||
let mockedPost; | ||
let mockedAptos: jest.Mocked<any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to inject the type for the generic Mocked ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do that, I get a Type 'MockedObjectDeep<typeof Aptos>' is not assignable to type 'Mocked<Aptos>'
If I do
let mockedAptos: jest.Mocked<any>; | |
let mockedAptos: jest.MockedObjectDeep<typeof Aptos>; |
I get Type '{ getAccountInfo: Mock<any, any, any>; }' is missing the following properties from type 'Aptos': config, account, ans, coin, and 111 more
Basically I'm not able to mock it without adding all of its properties.
Let me know if there's a better way to do it, I also hate to use any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you try with jest.MockedObjectDeep<Partial<typeof Aptos>>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Partial, I get an error on line 71:
mockedAptos.mockImplementation(() => ({
getAccountInfo: mockGetAccountInfo,
}));
mockImplementation does not exist
And if I remove mockedAptos = jest.mocked(Aptos);
from line 27, and add the following inside the tests
mockedAptos = jest.mocked(Aptos).mockImplementation(() => ({
getAccountInfo: mockGetAccountInfo,
}));
I get a similar error as before:
Type '{ getAccountInfo: Mock<any, any, any>; }' is missing the following properties from type 'Aptos': config, account, ans, coin, and 111 more.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok ! no worries, i'll resolve this
β Checklist
npx changeset
was attached.π Description
Replace this text by a clear and concise description of what this pull request is about and why it is needed. Be sure to explain the problem you're addressing and the solution you're proposing.
For libraries, you can add a code sample of how to use it.
For bug fixes, you can explain the previous behaviour and how it was fixed.
In case of visual features, please attach screenshots or video recordings to demonstrate the changes.
β Context
π§ Checklist for the PR Reviewers