25 + 5 Clock: code works but tests fail

Although the code seems to work, I am not passing any tests for my 25 + 5 Clock. Based on the error message, I think I am not passing the Technology Stack requirements, but I only used React to complete the assignment.

Here is my codepen:

Challenge: Build a 25 + 5 Clock

Link to the challenge:

Did you see that error message?

Script error. (:0)
Error: Script error. (:0)

I removed all React hooks (useState, useEffect, useRef) and now I am not getting the error message. Are we basically not allowed to use hooks on this assignment?

Not sure about hooks, but the first thing I noticed is no tests would pass because of a bug. Basically when you hit reset, there was an error that playBeep.pause() is not a function. Removing the () fixed that error. After that, tests will run, failing about 4… I noticed functionally, if you run your timer, and then hit reset, it resets all values, but the timer keeps counting… timer should stop on a reset.

Anyway, those are just a few bugs. I’d say fix the pause() line, then use the tests to identify other bugs and continue. Sorry I couldn’t answer any questions about the hooks though… I’m not that familiar with them.

2 Likes

Got everything to work (finally!). Thanks for pointing out those bugs! :slightly_smiling_face:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.