Closed sohjag closed 1 year ago
const { network, getNamedAccounts, deployments } = require("hardhat") const { developmentChains, networkConfig } = require("../../helper-hardhat-config") const { assert } = require("chai") !developmentChains.includes(network.name) ? describe.skip : describe("Raffle Unit Tests", function () { let raffle, vrfCoordinatorV2Mock beforeEach(async () => { const deployer = await getNamedAccounts() await deployments.fixture(["all"]) raffle = await ethers.getContract("Raffle", deployer) vrfCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock", deployer) }) describe("Constructor", function () { it("initializes raffle correctly", async () => { const raffleState = await raffle.getRaffleState() const interval = await raffle.getInterval() assert.equal(raffleState, "0") assert.equal(interval.toString(), networkConfig[chainId]["interval"]) }) }) })
│ ··············|··········|··············|·············|·············|·············|················ | Contract · Method · Min · Max · Avg · # calls · eur (avg) │ ·-------------|----------|--------------|-------------|-------------|-------------|---------------· 0 passing (12ms)
My project folder structure got messed up! Not an issue
The following code is not running any tests.
Here's the output