-
I'm on 15:28:20 in the video testing Raffle.test.js I'm getting this message when I try to 'hh test --grep "you don't pay enough" 0 passing' My folder is test/unit with Raffle.test.js as the file inside. My test: const { inputToConfig } = require("@ethereum-waffle/compiler")
const { assert, expect } = require("chai")
const { getNamedAccounts, deployments, ethers } = require("hardhat")
const { developmentChains, networkConfig } = require("../../helper-hardhat-config.js")
!developmentChains.includes(network.name)
? describe.skip
: describe("Raffle Unit Tests", async function () {
let raffle, vrfCoordinatorV2Mock
const chainId = network.config.chainId
beforeEach(async function () {
const { deployer } = await getNamedAccounts()
await deployments.fixture(["all"])
raffle = await ethers.getContract("Raffle", deployer)
vrfCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock", deployer)
})
decribe("constructor", async function () {
it("initializes the raffle correctly", async function () {
const raffleState = await raffle.getRaffleState()
assert.equal(raffleState.toString(), "0")
const interval = await raffle.getInterval
assert.equal(interval.toString(), networkConfig[chainId]["interval"])
})
})
describe("enterRaffle", async function () {
it("reverts when you don't pay enough", async function () {
await expect(raffle.enterRaffle()).to.be.revertedWith(
"Raffle__NotEnoughETHEntered"
)
})
})
}) My helper-hardhat-config: const { ethers } = require("hardhat")
const networkConfig = {
4: {
name: "rinkeby",
vrfCoordinatorV2: "0x6168499c0cFfCaCD319c818142124B7A15E857ab",
entranceFee: ethers.utils.parseEther("0.01"),
gasLane: "0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc",
subscriptionId: "0",
callBackGasLimit: "500000",
interval: "2",
},
31337: {
name: "hardhat",
entranceFee: ethers.utils.parseEther("0.01"),
gasLane: "0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc",
},
}
const developmentChains = ["hardhat", "localhost"]
module.exports = {
networkConfig,
developmentChains,
} Unsure of what folder needs to be changed as that's what I've noticed is others problems that run into this. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
@Focalized Show the console and for now just remove --grep |
Beta Was this translation helpful? Give feedback.
-
@Focalized Also, as mentionned by @ali-thegilfoyle it would be helpful if you paste the error message you are getting in the terminal as well as a screenshot of the results from running the cmd line |
Beta Was this translation helpful? Give feedback.
-
Update, I misspelled "describe", so after I changed that, I'm getting this error now This is a fun one :) |
Beta Was this translation helpful? Give feedback.
-
I figured it out, turns out I misspelled about 5 words, and needed to add the interval arg into my localhost package in my helper-hardhat-config file. Just some silly stuff, I'm sorry!!! |
Beta Was this translation helpful? Give feedback.
I figured it out, turns out I misspelled about 5 words, and needed to add the interval arg into my localhost package in my helper-hardhat-config file. Just some silly stuff, I'm sorry!!!