9 shows: 25 + 5 clock has started but time displayed is not changing : expected 0 to be above 0
10 shows: 25 + 5 has started but time displayed is not changing: expected ‘00’ to not equal ‘00’
11 shows: 25 + 5 clock has started but time displayed is not changing: expected ‘00’ to not equal ‘00’
specifically tests: it now fails 9, 10, and 11
NOTE: it is currently pretty ugly, i like to pretty it up once it actually works, and controls on audio are visible for testing
Please Help! This is getting sooooo frustrating
Thanks!
UPDATE 1: My current thinking is that the timer doesn’t start with the starting time… ex: 5min break goes from 00:00 to 4:59; I’m working on changing how it works, in hopes it solves the issue
UPDATE 2: I changed some things, solving most of my issues, all of the timer has not reached 0, but now i fail 9 10 and 11… error message updated
FINAL UPDATE: I changed how my clock works completely. twotani made me realize i could just decrement a set time instead of using date. I had to start over but it simplified my code and I finally pass everything!
I had a similar issue, and I share your frustration. What is happening, I believe, is that the timer did not lapse 1 second for showing the value of 0. In other words, display of all non-zeroes stayed on the display for one second, but the display of 0 disappears immediately. I solved the problem by changing my countdown function to
Initially I tested for timeLeft == 0 to switchClock() and then decrement the counter. By changing the code to decrementing the timeLeft counter before test and testing it for < 0 makes the display of 0 stay for one second.
I hope this helps. Also, when I had a problem, the tests ran for a long time because I think they repeatedly ran the same tests. If there’s no problem, the tests will complete fairly quickly.
thank you so much @twotani . Your example helped me solve and issue but more importantly made me realize there was a simpler way of doing things…
Instead of using date as endtime = date + timer etc… i just use endTime ## and decrement by 1000 milliseconds (could use seconds but i like to stick to milliseconds since that is what interval uses)