question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests refactoring checklist

See original GitHub issue

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:

  • Isolate the tests from each other, i.e. make all the setup before each test so that the state is reset #166
  • Add tests for appear / enter / leave animations
  • Do something with tests stability (see false positives like that: https://travis-ci.org/joshwcomeau/react-flip-move/jobs/236306660) #175
  • Add tests for runtime props conversion and checks #174
  • Use sandboxed sinon for easier resetting/restoring

Maybe needed:

  • Add simple unit tests for helpers — not really needed, they are fully covered by other tests
  • Use some code coverage tool like istanbul #172
  • Use enzyme for easier react output manipulation #169
  • Use sinon fake timers instead of setTimeout

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tobilencommented, Aug 28, 2017
  • regarding " Use sandboxed sinon for easier resetting/restoring", have you given jests mock functionality a look? we’ve replaced also most all of our sandboxes with the mocking toolset provided by jest.

  • regarding “Add tests for appear / enter / leave animations” we could look for classes mapped to animation (“–anim-start” etc.) maybe? i mean, short of that you need something like cypress.io for actual e2e testing i wager.

  • adding tests for high pressure situations (500 incoming elements, 200 leaving, 600incoming all incoming in short distance). it’ll most likely mess up sorting. we’d then have a red to work up from. i’ll probably build something in that regard this weekend

0reactions
joshwcomeaucommented, Jul 8, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to refactor
Checklist of refactoring done right way. The code should become cleaner. ... There are two cases when tests can break down after refactoring:....
Read more >
A red-green-refactor checklist - ploeh blog
Write a failing test. Did you run the test? Did it fail? Did it fail because of an assertion? · Make all tests...
Read more >
Code Refactoring: What You Need to Know About It
Understanding Code Refactoring: A Tester's Perspective. The term 'Refactoring' is mainly used to indicate required code cleanup/redesign.
Read more >
Refactoring Code Checklist - A Fumbling in Programming
Can the code be refactored? Do you need a seam? · Create Tests · Start with the deepest branch to shortest branch ·...
Read more >
A four-point checklist to factor in while refactoring applications ...
Validating the new version of an application requires running end-to-end tests and the entire regression test suite to ensure new changes do not ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found