faker icon indicating copy to clipboard operation
faker copied to clipboard

Reorganize test file locations

Open Shinigami92 opened this issue 3 years ago • 1 comments
trafficstars

Move test files into src folder with <module-name>.spec.ts or reorganize the test folder with subfolders

Shinigami92 avatar May 03 '22 13:05 Shinigami92

We wait with this until all functions are located in their separate file.

Example:

  • src
    • [...]
    • modules
      • address
        • city.ts
        • city.spec.ts
        • street.ts
        • street.spec.ts
        • [...]
      • animal
        • cat.ts
        • cat.spec.ts
        • dog.ts
        • dog.spec.ts
        • [...]
      • [...]

xDivisionByZerox avatar Sep 08 '22 17:09 xDivisionByZerox

Is this still how we intend to implement this?

ST-DDT avatar Mar 05 '24 17:03 ST-DDT

Is this still how we intend to implement this?

Not that sure. I'm in favor of staying in the test folder, so the test files don't accidentally bleed into dist.

Shinigami92 avatar Mar 05 '24 19:03 Shinigami92

Is this still how we intend to implement this?

Let's discuss this in the next team meeting (?)

xDivisionByZerox avatar Mar 05 '24 21:03 xDivisionByZerox

i like having all the tests in one folder seperate to src, it makes it easy to search all the test code.

matthewmayer avatar Mar 06 '24 04:03 matthewmayer

Pro

  • Tests are easier to find
  • The structure of your test directory matches your src directory, because they are in one directory

Con

  • Test files may bleed into dist
  • Test snapshots folders in every source module folder
  • Need a separate folder for common tests e.g. locale-data.spec.ts

Team Decision

  • We keep the tests in a separate test folder.
  • We can reopen this issue, if we want to reevaluate this design decision.

ST-DDT avatar Mar 14 '24 16:03 ST-DDT