bbc / lrud

Left, Right, Up, Down. A spatial navigation library for devices with input via directional controls.
Apache License 2.0
98 stars 21 forks source link

Move tests under `test` folder #51

Closed epatrasc closed 4 years ago

epatrasc commented 4 years ago

Description

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

edmorrish commented 4 years ago

my preference is for tests with the code rather than in a separate folder

epatrasc commented 4 years ago

Would appreciate some more justification around this. Adding coverage and updating dependencies is objectively good but changing the project structure for tests is a matter of personal preference.

my preference is for tests with the code rather than in a separate folder

I agree that a structural change should be first discussed but the choice of where to accommodate tests it's not only about preference. It has implication in the way the development happen and code maintained. Mixing test files and source creates confusion. We have endtoend, integration and unit tests in the source folder, all together. It's difficult to reason where a new test should be added for example. I can understand unit test with one to one file code+.test version but this is not the case.

We have:

utils.ts
utils.test.js

Fine but what about:

insert-tree.test.js
index-align.test.js
handle-key-event.test.js
focus-on-empty-node.test.js
cancellable-movement.test.js

What are they testing? They are end to end or integration test why they should live with the source code?

Bonus point: LRUD v2 structure was: src + test folder