AssertionError: expected '1' to equal '30' + expected - actual #196
Answered
by
PatrickAlphaC
mubashirhussainkhadim
asked this question in
Q&A
-
describe("constructor", () => {
it("intitiallizes the raffle correctly", async function () {
const interval = await raffle.getInterval()
const raffleState = (await raffle.getRaffleState()).toString()
assert.equal(raffleState , "0")
assert.equal(interval.toString(), networkConfig[chainId]["interval"])
})
}) with equal its cause an error
describe("constructor", () => {
it("intitiallizes the raffle correctly", async function () {
const interval = await raffle.getInterval()
const raffleState = (await raffle.getRaffleState()).toString()
assert == (raffleState , "0")
assert == (interval.toString(), networkConfig[chainId]["interval"])
})
}) with == operator test is pass
|
Beta Was this translation helpful? Give feedback.
Answered by
PatrickAlphaC
Jun 8, 2022
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mubashirhussainkhadim
-
describe("constructor", async function () {
it("initiliazes the Constructor correctly", async function () {
const raffleState = await raffle.getRaffleState()
const interval = await raffle.getInterval()
assert.equal(raflleState.toString(), "0")
assert.equal(interval.toString(), networkConfig[chainId]["interval"])
})
}) test is passed with equal function thanks patrick |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
assert ==
. The test are passing because that doesn't mean anything.const interval = await raffle.getInterval()
is returning 1, and your config correctly has 30. Go check how you're deploying this contract, you're likely importing the wrong variable. What does your helper-hardhat-config.js & your deploy script look like?