Even if the tests look daunting, take your time. Work through line by line - it will help you learn even more.
Do exactly as you have to debug so far - place console.log everywhere!
To use the test I posted earlier, I would create a small function at the bottom of your JS code, calling the test. Ensure to console.log as many of the variables as necessary so you do not miss an error/step.
Remember, the browser console is much better than the CodePen one. (I never use the CodePen console anymore).
This is difficult to say. The tests are mostly asynchronous. So, this could be a discrepancy of one test running during the condition your code passes, and another not.
The screenshot shows that, at the point of changing from one state to another (session to break), the #time-left innerText does not match the tests regex:
Do you know offhand why it is doing that. I thought I had prepended “0” for anything under 9 for all the cases that it was happening?
Do you think it might be because there isn’t enough time between when the sessionInterval switches over to the breakInterval? … Or something else?
I placed if (sessionTimer.minutes <= 9 && sessionTimer.minutes[0] !== "0") {setSessionTimer(prev => ({minutes: "0" + prev.minutes, seconds: "00"}))} after the breakInterval/Timeout and it seems to have fixed the issue.
I though it would be worth a shot to try to use some React Hooks, and it worked, except for that one prependation I missed, but TTG and thanks to you, the final failing test passes.
I was looking at that link you gave me concerning the github test for the clock.
You said to read it line by line. Should I read it from the very beginning or from the starting point of where they write the test?
Do I have to download or do anything else for that github to be able to debug for the challenge?
I ask because I see import and export statements at the beginning of the code and just incase I have to look at another such code in regards to any future test/challenge from FCC.
This depends on if you know what you are looking for. I knew I was looking for that specific failing test. So:
I searched for the test words, and found the function
I searched for anything looking for the property 1 of something that would give the error shown in the tests.
Fortunately, there was only one bit of code trying something[1], and it was related to step 1 above. So, follow that thread.
If you really wanted to, you could fork/download the repo with the tests, and use it (alter it) to run the tests locally on your own environment. This way, you have more control over what the output would be.
For now, provided you are wanting to go down this path, I suggest you continue with the fCC curriculum, because fCC teach what they use. So, you will automatically become more familiar with the tests, as you go.
When you say thread, is that just another way to say line of code?
After submitting my Pomodoro Clock, I’m continuing with the FCC curriculum. I’m doing D3 JS tutorial right now. I hope as I go along, things will become more clearer and that I’ll get better and better at coding.
I think, whether you choose to answer that last question above, I’m leave you be… especially since you’ve probably got things to do.