PatrickAlphaC / hardhat-fund-me-fcc

82 stars 184 forks source link

error running test #127

Closed Muktarsadiq closed 1 year ago

Muktarsadiq commented 1 year ago

at 11:50:00 I tried to run all my test locally but they all failed and produced these errors FundMe constructor

  1) sets the aggregator addresses correctly
fund

  2) Fails if you don't send enough ETH

  3) Updates the amount funded data structure

  4) Adds funder to array of funders
withdraw

  5) withdraw Eth from a single funder

  6) allows us to withdraw with mutiple funders

  7) lets only the owner withdraw funds

0 passing (1s) 7 failing

1) FundMe constructor sets the aggregator addresses correctly: TypeError: FundMe.getPriceFeed is not a function at Context. (test/staging/units/FundMe.test.js:23:43) at processImmediate (node:internal/timers:466:21)

2) FundMe fund Fails if you don't send enough ETH: AssertionError: Expected transaction to be reverted with reason 'You need to spend more ETH!', but it reverted with reason 'Didn't send enough!' at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7) at Context. (test/staging/units/FundMe.test.js:30:13)

3) FundMe fund Updates the amount funded data structure: ReferenceError: fundMe is not defined at Context. (test/staging/units/FundMe.test.js:36:30) at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7)

4) FundMe fund Adds funder to array of funders: TypeError: FundMe.getFunder is not a function at Context. (test/staging/units/FundMe.test.js:43:43) at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7)

5) FundMe withdraw withdraw Eth from a single funder: TypeError: FundMe.provider.getbalance is not a function at Context. (test/staging/units/FundMe.test.js:56:67) at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7)

6) FundMe withdraw allows us to withdraw with mutiple funders: TypeError: FundMe.provider.getbalance is not a function at Context. (test/staging/units/FundMe.test.js:78:71) at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7)

7) FundMe withdraw lets only the owner withdraw funds: AssertionError: Expected transaction to be reverted with reason 'NotOwner', but it reverted with a custom error at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7) at Context. (test/staging/units/FundMe.test.js:103:13)

PatrickAlphaC commented 1 year ago

I just cloned the repo and tests are passing OK for me.

What happens when you do:

git clone https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
cd hardhat-fund-me-fcc
yarn
yarn test

If you still get an error, please update the issue. Otherwise: 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
Sami-Shafi commented 1 year ago

I think you should rename it to fundMe not FundMe when you call the functions