Skip to content

refactor: move tests to specificly related folders #531

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

Merged
merged 4 commits into from
Jan 10, 2021

Conversation

joshuaellis
Copy link
Member

What:

Proposal to move test files to be closer to the code that we're testing, and rename those test files to be *.test.ts(x).

Why:

This was discussed in #510, I'd say the main issue is they're all named the same and incredibly close together, now we're maintaining "three engines" we may mind that the testing needs to diverge, an example is seen in src/server where we need to test the hydration warnings. It also, imo, makes the repo look tidier.

Renaming the tests was a personal choice, if i'm jumping around a lot of files, it's really helpful to understand whats a test file just from the name. Added bonus, you normally get a different icon in your IDE.

Also we do want to try and figure out how to cover src/pure.ts so this wouldn't actually fit into the old test folder pattern because they were related to the renderer. Therefore when we cross that bridge I would suggest putting the test in src/__tests__ and thus naming it pure.test.ts.

Checklist:

  • Tests
  • Ready to be merged

@joshuaellis joshuaellis requested a review from mpeyper January 9, 2021 17:37
@joshuaellis
Copy link
Member Author

hm. probably need to move that tsconfig.json out of src/__tests__ and just into test.... that's annoying.

Copy link
Member

@mpeyper mpeyper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions, but no showstoppers

@mpeyper
Copy link
Member

mpeyper commented Jan 9, 2021

You have forgotten to update the eslintrc file which is why the CI is failing.

@mpeyper
Copy link
Member

mpeyper commented Jan 9, 2021

hm. probably need to move that tsconfig.json out of src/__tests__ and just into test.... that's annoying.

If my other comments are right, you can just delete it

@mpeyper mpeyper force-pushed the refactor/tests-proposal branch from 9c3d9b1 to a86fd96 Compare January 10, 2021 10:00
@codecov
Copy link

codecov bot commented Jan 10, 2021

Codecov Report

Merging #531 (2957443) into beta (ca32bce) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              beta      #531   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          189       189           
  Branches        27        27           
=========================================
  Hits           189       189           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca32bce...2957443. Read the comment docs.

@mpeyper mpeyper merged commit 43891e1 into beta Jan 10, 2021
@mpeyper mpeyper deleted the refactor/tests-proposal branch January 10, 2021 10:18
@joshuaellis
Copy link
Member Author

Thanks for doing those updates.

@github-actions
Copy link

🎉 This PR is included in version 5.0.0-beta.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants