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:
Pomodoro Clock by sitek94 using @material-ui/core, @material-ui/icons, @testing-library/jest-dom, @testing-library/react, @testing-library/user-event, @types/jest, accurate-interval, react, react-dom
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.
I deployed it to gh-pages and it passes all the tests, thanks!
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?
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
here to find this:
const config = configFactory('development');
here uses this:
const config = configFactory('production');
Finally, you can see the differences in the webpack config
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
Thank you so much for help!
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.)