PatrickAlphaC / hardhat-fund-me-fcc

82 stars 182 forks source link

When staging test , I met an error :1) Uncaught error outside test suite #185

Closed rocco1226 closed 4 months ago

rocco1226 commented 5 months ago

I met an issue: Uncaught error ouside test suite. What is it? This is terminal shows: yarn hardhat test --network sepolia yarn run v1.22.21 warning package.json: No license field $ /home/roccomyluv/hh-fcc/hardhat-fund-me-fcc/node_modules/.bin/hardhat test --network sepolia FundMe Staging Tests 1) Uncaught error outside test suite Done in 2.77s. This is staging test: ` const{ getNamedAccounts, ethers, network } = require("hardhat") const { developmentChains } = require("../../helper-hardhat-config") const { assert } = require("chai")

developmentChains.includes(network.name) ? describe.skip : describe("FundMe Staging Test", async function () { let fundMe let deployer const sendValue = ethers.parseEther("0.1") beforeEach(async function () { deployer = (await getNamedAccounts()).deployer fundMe = await ethers.getContract("FundMe", deployer) }) it("allows people to fund and withdraw", async () => { await fundMe.fund({ value: sendValue }) await fundMe.withdraw() const endingBalance = await ethers.provider.getBalance( fundMe.target, ) assert.equal(endingBalance.toString(), "0") }) }) ` And I have tried the code in the repo, and the same error. Some helps please?

PatrickAlphaC commented 4 months ago

Thanks for this!

Can you:

  1. Make this a discusson on the full repo? https://github.com/smartcontractkit/full-blockchain-solidity-course-js/
  2. Follow this section for formatting questions? https://www.youtube.com/watch?t=19846&v=gyMwXuJrbJQ&feature=youtu.be
rocco1226 commented 4 months ago

Thanks for this!

Can you:

  1. Make this a discusson on the full repo? https://github.com/smartcontractkit/full-blockchain-solidity-course-js/
  2. Follow this section for formatting questions? https://www.youtube.com/watch?t=19846&v=gyMwXuJrbJQ&feature=youtu.be

Oh, thanks very much! I have solved the issue by myself. Currently I don't need help regarding this discussion.