Lesson 9 - Staging Test Promise Not Resolving #3521
Replies: 3 comments 11 replies
-
@JussaMouse here you should also add console.log statements to see the location of error. assert.equal(recentWinner.toString(), accounts[0].address);
console.log("Checkpoint 1");
assert.equal(raffleState, 0);
console.log("Checkpoint 2");
assert.equal(
winnerEndingBalance.toString(),
winnerStartingBalance.add(raffleEntranceFee).toString()
);
console.log("Checkpoint 3");
assert(endingTimestamp > startingTimestamp);
console.log("Checkpoint 4");
resolve(); |
Beta Was this translation helpful? Give feedback.
-
mine still doesnt work after checking all the related threads and fixes, can someone help? |
Beta Was this translation helpful? Give feedback.
-
After hours of debugging in vscode javascript debug terminal, I found the fix. The issue is with the gas reporter. In your gasReporter: {
enabled: false, // disable for staging test
outputFile: "gas-report.text",
noColors: true,
currency: "USD",
coinmarketcap: COINMARKETCAP_API_KEY,
token: "ETH",
}, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
VRF and Keepers are working, WinnerPicked event is firing, and it seems like everything is working. BUT, after all that happens, the test just hangs. It never outputs the pass/ fail report and terminates. I have tried swapping out my code with a copy/paste of the Raffle.staging.test.js from the github here and that didn't work either. I have added a console.log after every "await" inside the promise and they all output as expected. Can anyone tell me why my resolve() is apparently never hitting?
Raffle.staging.test.js:
Terminal output:
Then it just hangs
until the mocha timeoutforever (edited). Any tips would be very appreciated!Beta Was this translation helpful? Give feedback.
All reactions