Error When Running My Test, Says Too Many Arguments.. #883
Answered
by
alymurtazamemon
Benrockiee
asked this question in
Q&A
-
After running my test, one passes and the other does not..
And this is my Test const { ethers } = require("hardhat")
const { expect, assert } = require("chai")
describe("EtherWallet", function () {
let Etherwallet
let EtherwalletFactory
//let etherWallet, etherWalletFactory
beforeEach(async function () {
EtherwalletFactory = await ethers.getContractFactory("etherWallet")
Etherwallet = await EtherwalletFactory.deploy()
})
it("should start with a balance of 0", async function () {
const currentValue = await Etherwallet.getBalance()
const expectedValue = 0
//assert
//expect
assert.equal(currentValue.toString(), expectedValue)
// expect(currentValue.toString()).to.equal(expectedValue)
})
it("Should update when we call deposit", async function () {
const expectedValue = "7"
const transactionResponse = await Etherwallet.deposit(expectedValue)
await transactionResponse.wait(1)
const currentValue = await Etherwallet.getBalance()
assert.equal(currentValue.toString(), expectedValue)
})
}) |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Jul 12, 2022
Replies: 2 comments 2 replies
-
bro paste your contract code, I think you have passed the wrong argument
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@Benrockiee I think this is similar to the fund me contract, and you want to send the amount to this method. - await Etherwallet.deposit(expectedValue)
+ await Etherwallet.deposit({value: expectedValue}); //it should be like this. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Benrockiee
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Benrockiee I think this is similar to the fund me contract, and you want to send the amount to this method.