Tell us what’s happening:
It’s failing the tests that check for time running all the way down to 00:00
Timer has not reached 00:00.
Error: Timer has not reached 00:00
Visually you can see the time running down to 00:00, so it’s hard for me to understand why the tests fail.
To save some time getting a visual confirmation, use the 5 second button in the debug panel.
You can see for yourself at the codepen link below.
Is this test 17, the first one in the timer section? I’m also failing at this same portion. The description have 6 sub-tests. Mine will mechanically work as described in the user stories, and fails anyway.
Thanks Mark, I’ll do the same. My fails everytime it tests for 00:00. But I can see that it counts down to 00:00 and it remains there for the full second until switching modes.
I’ve met the same error today, then I figure out it’s not about dispaly format. I pass the test after changing the inaccurate setInterval() to recursive setTimeout(), like this:
Hi Mark, did you resolve this? I found that their test code isn’t quite right. If you are using the setInterval interval as your time basis then it should pass the tests. On the other hand, using the system clock as your time basis (and monitoring that using setInterval) causes it to fail. This is a problem because setInterval as a time basis is not a good way to time things. I’ve written it up as an issue. Curious to see their response.
I have not. I was going to make a ticket as well, but I’ll add on to yours with a screenshot of my app at 00:00. Mine is built in react-redux. I’ve decided to build a simpler version with just react, and I’ll see if I can make it work that way. Unfortunately, I think it’s the test. I’ll be on the road so it may take a couple of days. Thanks for being diligent. It’s annoying to make it this far, and to hit a road block that may be out of my control.
In my case at least it is due to the the test assuming you are using setInterval or setTimeout as your basic timer. I instead am using the system clock (i.e. Date) and polling that using setInterval.
Here’s the problem, the test hijacks both setTimer and setTimeout and clocks them at 30msec so that the tests run in a reasonanble length of time. It then uses your UI to set the lengths of break and session to 1 minute. Then it starts your pomodoro and expects to see 00:00 in less than 5 seconds. At 30msec/1sec this would work. This doesn’t work in my case. It just causes my software to poll the system clock more often but the system clock of course is not affected. So at the end of 5 seconds it sees the display at 00:55 and fails.
I wrote up an issue on freecodecamp github and I see that ValeraS has made a pull request, so it should be fixed in however much time it takes for them to complete the process, I guess they take their time to make sure the change is done properly.
No I dont think so they have fixed this issue as I am able to see my clock at 00:00 when run manually but during the test suite I’m failing the test again and again.please help !!
Sometimes the error code shows “00:00” when it’s something else. It will say something like, “5 should equal 1,” and it means it should do that at the zeroes.
I was having this problem too. My tests passes all of a sudden after I created a >>this.state.timer<< property that holds the default 25:00 string. In detail, my callback function inside the setInterval method decrements the >>this.state.minutes<< and >>this.state.seconds<< property accordingly. Then I call another of my created methods, the >>this.createTime(this.state.minutes-1, 59)<< or alternatively the this.createTime(this.state.minutes, this.state.seconds-1). Thus the this.createTime method concatenates the this.state.minutes and this.state.seconds together into my this.state.timer property which is passed and {shown} in the child component.
I did not use a Date object. I felt this approach was extra. I avoided the ternary ()?return:return option.
When I first started, I didn’t have a this.state.timer property. I just used a this.state.minutes and this.state.seconds and passed it to the rendering child component to be altered with a ternary operation. I’m not sure why it didn’t work at first. Maybe when I clicked pause the state wasn’t fully set yet and the tests didn’t see what it expected. But with a createTime function, I made sure to update the timer string to reflect the very moment we’ve reached a new 1000ms interval.
I guess you can also say I solved the problem by refactoring and trying again.
Hey guys… just in case someone makes the same mistake… in my case the problem was that when the remaining time was 0 seconds, I would display it as 0:00, not 00:00… I had only added padding to the seconds portion of the timer.
I am also dealing with this issue. I tried pretty much everything and the result remains the same: timer works well in the browser, but in testing suite it has a glitch and transition is being initiated sooner than it is supposed to.
my code has another setTimeout which works just fine, so I at least know that environment can handle it