Do you put tests outside the `tests/` folder?

I like putting test file next to the code file.
(fictional) example:

  • ChiSquared.elm // the module
  • ChiSquared.spec.elm // the specifications (unit tests) for the module

This makes it easier to find the test and also lets you know which files (modules) have tests at a glance. (I first encountered this developing angular applications, the reasoning was - that modules should be self contained - and easy to move into libraries or just copy/pasted into other applications). More info on the angular team reasoning can be found here: test file name and location

2 Likes