-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests refactoring checklist #162
Comments
Awesome! Yeah, so I originally wrote this module when I was completely inexperienced with React tests. I still don't have a ton of experience with it, but I can certainly see how bad they are now. The easiest and most crucial win is just separating each test, as you say, so that each test mounts its own DOM, performs the test, and then unmounts it. The false-positives thing has been very tricky in my experience - Working locally, the timing is very accurate, but on CI the timing is far less predictable. An animation set to 500ms will usually be within a few ms locally, but can take 1000-1500ms on travis, for reasons that aren't super clear to me. The "maybe needed" stuff all sounds good to me - the helpers really should be unit-tested, and I like Istanbul/Enzyme. |
Maybe the problem is that we don't take two skipped frames into account? |
Yeah, maybe if CI only runs at 1-2fps, it could explain it. |
|
Initially, I created a project, but then I realised that it's not commentable so maybe an umbrella issue with checklist would be more useful, so I duplicate it as such.
@joshwcomeau has mentioned that he would like to have some improvements. So I decided to make some kind of checklist for what has to be done. Feel free to add anything that you think would be nice to do.
Definitely needed:
Maybe needed:
Add simple unit tests for helpers— not really needed, they are fully covered by other testsUse sinon fake timers instead ofsetTimeout
The text was updated successfully, but these errors were encountered: