Skip to content
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

Reorganize test file locations #911

Closed
Shinigami92 opened this issue May 3, 2022 · 6 comments
Closed

Reorganize test file locations #911

Shinigami92 opened this issue May 3, 2022 · 6 comments
Labels
c: test p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision s: on hold Blocked by something or frozen to avoid conflicts
Milestone

Comments

@Shinigami92
Copy link
Member

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

@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent c: test s: needs decision Needs team/maintainer decision labels May 3, 2022
@Shinigami92 Shinigami92 moved this to Todo in Faker Roadmap May 3, 2022
@Shinigami92 Shinigami92 added this to the v7 - Current Major milestone May 3, 2022
@ST-DDT ST-DDT added s: on hold Blocked by something or frozen to avoid conflicts s: accepted Accepted feature / Confirmed bug and removed s: needs decision Needs team/maintainer decision labels Sep 8, 2022
@xDivisionByZerox
Copy link
Member

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
        • [...]
      • [...]

@ST-DDT
Copy link
Member

ST-DDT commented Mar 5, 2024

Is this still how we intend to implement this?

@Shinigami92
Copy link
Member Author

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.

@xDivisionByZerox
Copy link
Member

Is this still how we intend to implement this?

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

@ST-DDT ST-DDT added s: needs decision Needs team/maintainer decision and removed s: accepted Accepted feature / Confirmed bug labels Mar 5, 2024
@matthewmayer
Copy link
Contributor

matthewmayer commented Mar 6, 2024

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

@ST-DDT
Copy link
Member

ST-DDT commented Mar 14, 2024

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 ST-DDT closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: test p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision s: on hold Blocked by something or frozen to avoid conflicts
Projects
No open projects
Status: Todo
Development

No branches or pull requests

4 participants