-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: mocks can be deployed with libs #68
Conversation
it('should be able to use libraries', async () => { | ||
const testLibrary = await (await ethers.getContractFactory('TestLibrary')).deploy(); | ||
const librarian = await ( | ||
await smock.mock<Librarian__factory>('Librarian', { | ||
libraries: { | ||
TestLibrary: testLibrary.address, | ||
}, | ||
}) | ||
).deploy(); |
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.
🚀
|
||
chai.use(smock.matchers); | ||
|
||
describe.only('Mock: Initialization', () => { |
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.
😠
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.
Solved, forced push commit
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.
very clear work ape! take a look at the tests, there's some warnings
i don't think is necessary to mock/fake libraries but if that's your objective u should go for it
🥇
14daa74
to
d84af92
Compare
Description
Mocks now receive the same arguments as
ethers.getContractFactory
and it forwards them to the real function