I’m passing all the test for the Pomodoro Clock’s (25 +5) test suite even though my clock is working well.
I clicked “debugger mode” in my Codepen, and then I opened the console and it doesn’t show any errors even when I’m running it or doing different things with it.
I found out the error is happening at the setSessionTimer part of the code below, specifically, the sessionLength variable/value of the minutes key/property:
if (sessionTimer.minutes == 0 && sessionTimer.seconds == 0) {
// beep.play();
setSessionTimer(prev => ({minutes: sessionLength, seconds: "00"}));
console.log("Session Timer Error Point", sessionTimer.minutes, sessionTimer.seconds, sessionLength, SessionLength, {minutes: sessionLength, seconds: "00"});
setTimerLabel("Break Timer");
}
I placed a console.log after the point of where the error is happening to test the variable, but the variable is longing, so maybe it’s a bug in the test suite or something else I have no clue of.
Here’s the console.log:
console.log(“Session Timer Error Point”, sessionTimer.minutes, sessionTimer.seconds, sessionLength, SessionLength, {minutes: sessionLength, seconds: “00”});
Here’s the error:
“TypeError: Cannot read property ‘1’ of null”
Here’s my codepen if you would like to check it out:
Please help. I would like to submit my work to FCC and move on to the next curriculum challenge or learning material.