You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing tests for my smart contracts.
I am using deployments.get() to get my deployed contracts. fundMe = await deployments.get("FundMe", deployer)
Now if I use fundMe.fund() in the testing code, it will give me an error:
TypeError: fundMe.fund is not a function
While if I use fundMe.fund instead, it will work just fine.
So the main problem arises when I have to enter the parameters for a function which I can't without using ().
Minimal reproduction steps
Add hardhat-deploy,hardhat-deploy-ethers and hardhat using yarn.
Override hardhat-ethers using the command
Hey @eik-1, sorry but we'll need more detailed reproduction steps. Ideally a repository with a minimal reproducible example that we can just clone and run some commands to reproduce the problem.
Version of Hardhat
2.18.1
What happened?
I am writing tests for my smart contracts.
I am using deployments.get() to get my deployed contracts.
fundMe = await deployments.get("FundMe", deployer)
Now if I use
fundMe.fund()
in the testing code, it will give me an error:While if I use
fundMe.fund
instead, it will work just fine.So the main problem arises when I have to enter the parameters for a function which I can't without using ().
Minimal reproduction steps
Add
hardhat-deploy
,hardhat-deploy-ethers
andhardhat
using yarn.Override hardhat-ethers using the command
Write unit test for contracts.
Use the functions inside the contract using () at the end of function name.
Search terms
Testing
The text was updated successfully, but these errors were encountered: