Lesson 9: TypeError: interval.toNumber is not a function - when run unit test #6240
Replies: 3 comments 2 replies
-
check the value of console.log(interval); maybe it's |
Beta Was this translation helpful? Give feedback.
-
Hi @Longhoangger await network.provider.send("evm_increaseTime", [interval.toNumber() + 1]) By this : await network.provider.send("evm_increaseTime", [Number(interval) + 1]) Another issue : |
Beta Was this translation helpful? Give feedback.
-
The programing language you using in the test is javascript. In javascript, there is no toNumber method on the Number object, you can check MDN for more details. Try using Number(interval) or +interval. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm follow the course at 15:35:19 and I'm running Raffle.test.js in unit test and I run into this error. I tried Number(), toString(), BigInt() and all of them didn't work. I don't know if it's a hardhat error or an error in my code, so I also added here my hardhat.config.js. Please help, thank you!
The error showing:
This is my hardhat.config.js file
Beta Was this translation helpful? Give feedback.
All reactions