-
So, I'm at Lesson 9 trying to run some Unit tests. When I try to run hh test --grep "records players when they enter" in the terminal, I get the error: Lottery Unit Tests
enterLottery
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 is the Deployer
1) records players when they enter
0 passing (368ms)
1 failing
1) Lottery Unit Tests
enterLottery
records players when they enter:
AssertionError: expected '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb…' to equal undefined
at Context.<anonymous> (test/unit/Lottery.test.js:41:26)
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 I logged the deployer and it's showing me the correct address, but seems like it expects something else than the result it receives. Here is my link to repo, hope somebody can help me out. P.S. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
AGH, I knew it was something outrageous. let deployer as a state variable, and then said: beforeEach(async function () {
const deployer = (await getNamedAccounts()).deployer
console.log(`${deployer} is the Deployer`) instead of beforeEach(async function () {
deployer = (await getNamedAccounts()).deployer
console.log(`${deployer} is the Deployer`) 🙃 |
Beta Was this translation helpful? Give feedback.
AGH, I knew it was something outrageous.
If somebody else is wondering the culprit was the "deployer" variable. I defined the
as a state variable, and then said:
instead of
🙃