Pomodoro Clock Test #8

While not as frustrating as the calculator this project seems to work and it is displaying how it is meant to but it is failing test #8 and I can’t work out why.

  1. I can see an element with corresponding id=“time-left”.
    NOTE: Paused or running, the value in this field should always be displayed in mm:ss format (i.e. 25:00).
    Timeout of 2000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.
    Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.
    at i.g._timeoutError (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:39286)
    at l (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:37778)
    at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:38751

Here is the timer component and the function that formats the timer variable to display it in the correct way.

Hope someone can help :slight_smile:

export default function Timer({timer, sessionState}) {

    const displayTimer = () => {
        const minutes = (timer / 60) < 10 ?
            `0${Math.floor(timer / 60)}` :
            Math.floor(timer / 60);

        const seconds = (timer % 60) < 10 ? 
            `0${timer % 60}` :
            timer % 60;

        return `${minutes}:${seconds}`;
    }

    return (
        <section id="timer">
            <h2 id="timer-label">{sessionState}</h2>
            <div id="time-left">
                {displayTimer()}
            </div>
        </section>
    )
}

Hi @rsheppard83 !

I am getting all tests passing.
So maybe you fixed it.

1 Like

Thats really weird I haven’t changed anything.

I just ran tests and got 28/29 then ran it a second time and got 29/29.

I have been getting alot of strange test results from this project where I seem to have done something and it was telling me I hadn’t.

Thanks for checking for me.