Pomodoro Test Suite Missing And Error: "#Mocha" Div Missing so I can't test my pomodoro clock : (

Here is a screenshot, just for reference how I found this out:

Well, now is an excellent time to learn. I do not have the best methods for this, but manage to get by with:

  1. Having a read through the tests (this goes for any code I have worked with)
  1. Even if the tests look daunting, take your time. Work through line by line - it will help you learn even more.
  2. Do exactly as you have to debug so far - place console.log everywhere!
  3. 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.
  4. 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.

Hope this helps

1 Like

Please forgive me, I’m sorry for asking, but as I’m looking at your screen shot, what is it that I’m suppose to be noticing?

Is it that the 1 needs a 0 in front of it?

No need to worry about asking.

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:

/^(\d{2,4})[\.:,\/](\d{2})$/

This likely causes the test to fail.

Edit:

Exactly.

1 Like

Thank you so much for helping me.

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.

All the tests pass now!

Excellent job getting that working.

I did not find out why.

It is interesting to see how so many campers implement this challenge in so many different ways, though.

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:

  1. I searched for the test words, and found the function
  2. I searched for anything looking for the property 1 of something that would give the error shown in the tests.
  3. 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.

You’re a great help. :slightly_smiling_face:

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.

Yes, but, more specifically, follow the functions.

One of the things I enjoy doing is being on this forum. So, if you need assistance/have a question, ask away.

1 Like