Pomodoro Clock - Timeout exceeded?

Hi everyone!

I’ve finished my Pomodoro Clock, it seems to work but there is one test that I can’t get over with.

Timeout of 2000ms exceeded. For async tests and hooks, 
ensure "done()" is called; 
if returning a Promise, ensure it resolves.

What’s really strange is that couple of times all tests passed including this one, so I don’t know if it is problem with my code or what. Anyone had similar issue?

Here is link to my pomodoro clock:

Hey Maciek,

yes, seems odd.

The app feels very sluggish on codesandbox.
I would try to run it locally or on Netlify and run the tests there, maybe this will give you some hints if it’s a codesandbox problem or not.

But the fact, that is sometimes passes all tests is a good one.

1 Like

I deployed it to gh-pages and it passes all the tests, thanks! :smiley:
https://sitek94.github.io/pomodoro-clock/

I don’t have much experience with building and deploying apps so please correct me if I’m wrong but my idea is that when I deployed the app it uses now production build so it’s much lighter hence run faster?

Exactly.

In your package.json, there are these two scripts:

"start": "react-scripts start",
"build": "CI=false react-scripts build",

You can dig into the code of the start script here to find this:

const config = configFactory('development');

and the build script here uses this:

const config = configFactory('production');

Finally, you can see the differences in the webpack config here.

1 Like

All right, I think I have better understanding of how all this works. I mean I didn’t understand much of the source code itself but I get the idea behind it :slight_smile:

Thank you so much for help!

1 Like

I think the major takeaway is, like you already mentioned, that the production build is highly optimized for end users (small file size etc.) and the developer build is optimized for developers (readable code, fast rebuilds, react dev tools etc.)