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'm following the web3 course and I came across an issue when testing my hardhat fund me Contract. My tests just stopped running. I get: $ npx hardhat test 0 passing (2ms)
every single time I run the test command. It was running at first, but it stopped after adding new test criteria. I undid the changes and it wasn't successful, it's more like my test files aren't detected. I've done everything I could but I'm not getting a positive result. I created a sample test file that ran successfully but the test file that includes my FundMe Contract doesn't get detected and didn't run. I renamed the test file name but still no positive result. But when I intentionally create an error in the FundMe test file and run the test command, It detects the test file and throws that Error, but if error codes are reverted the FundMe test doesn't run.
I also tried running npx hardhat coverage. Then got a result showing that I hadn't written the test for my FundMe Contract yet, when the test is available. So please I need someone to help me out because other tests are running and the FundMe below isn't.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm following the web3 course and I came across an issue when testing my hardhat fund me Contract. My tests just stopped running. I get:
$ npx hardhat test 0 passing (2ms)
every single time I run the test command. It was running at first, but it stopped after adding new test criteria. I undid the changes and it wasn't successful, it's more like my test files aren't detected. I've done everything I could but I'm not getting a positive result. I created a sample test file that ran successfully but the test file that includes my FundMe Contract doesn't get detected and didn't run. I renamed the test file name but still no positive result. But when I intentionally create an error in the FundMe test file and run the test command, It detects the test file and throws that Error, but if error codes are reverted the FundMe test doesn't run.
I also tried running
npx hardhat coverage
. Then got a result showing that I hadn't written the test for my FundMe Contract yet, when the test is available. So please I need someone to help me out because other tests are running and the FundMe below isn't.`const { deployments, ethers, getNamedAccounts } = require("hardhat");
const { expect } = require("chai");
const { developmentChains } = require("../../helper-hardhat-config");
!developmentChains.includes(network.name)
? describe.skip
: describe("FundMe Contract", async () => {
let fundMe;
let deployer;
let mockV3Aggregator;
const sendValue = ethers.utils.parseEther("1");
beforeEach(async () => {
// deploy FundMe contract
// using hardhat-deploy
deployer = (await getNamedAccounts()).deployer;
// const deployer = await ethers.getSigners();
await deployments.fixture(["all"]);
`
Beta Was this translation helpful? Give feedback.
All reactions