Skip to content

Conversation

@kkartunov
Copy link
Collaborator

@kkartunov kkartunov commented May 2, 2023

image

@kkartunov kkartunov requested review from maxtopc and testflyjets May 2, 2023 10:12
Copy link
Contributor

@testflyjets testflyjets left a comment

Choose a reason for hiding this comment

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

Just one question -- what's the best practice for where the tests should live? I think having them directly alongside the executable code makes it harder to find the module you need, so would a /test directory make sense?

Copy link

@maxtopc maxtopc left a comment

Choose a reason for hiding this comment

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

This is great!! Thank you, Kiril! I personally also prefer having the tests in a folder (as Chris had mentioned). It is a matter of preference of exact location/naming, of course, but I prefer having them in a _tests folder (the underscore, underscoring that it is not part of the code!). Also a matter of preference, but if there is a big set of features where it has its own folder (in the case of helper.js being in the common folder), I personally would put the _tests folder (or just tests folder if you aren't a fan of the _tests with the underscore) in that same folder (vs. putting them all in the src folder). I also am a fan of having a features folder if we are adding reusable, stand-alone features in the future and having them be as independent as possible, where if they have to make calls to other parts of the project, they via facade pattern in just one contact point vs. direct imports/calling all over the code) and then having those have their own test folders as well -- so basically, in a folder as close to the code as possible would be my vote! Thanks again for taking this on!

@kkartunov
Copy link
Collaborator Author

@testflyjets @maxtopc both wyas are popular:

  • Putting all of your test code into a neatly organized /tests directory.
  • Putting your test code next to the files they are testing.

I moved them to neatly organized /tests directory which mimic the src folder structure so we know where to search for the tests.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants