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

move __tests__ into src #83

Open
christopher-johnson opened this issue Dec 13, 2018 · 3 comments
Open

move __tests__ into src #83

christopher-johnson opened this issue Dec 13, 2018 · 3 comments

Comments

@christopher-johnson
Copy link
Contributor

since the tests are source files, it would be correct to put them in the src directory. Also, IDEA has an issue that if the tests are not in src than it bails before execution. In Java, it is conventional to have the tests in a test directory and the tested code to be in main within the src directory. This is a pretty solid pattern that might be worth emulating in JS.

@mejackreed
Copy link
Collaborator

Just historical context here, we put them in ./__tests__ because of the convention of the Jest community: https://jestjs.io/docs/en/configuration#testmatch-array-string .

@christopher-johnson
Copy link
Contributor Author

christopher-johnson commented Dec 14, 2018

right. the double underscore convention can be preserved, though I find it to be a somewhat "tedious to type" semantic. if the tests are named like ?(*.)(spec|test|unit) then the testMatch pattern in the #82 config will also find them in src/test, src/__tests__ or src/something/test. btw, the IDEA question seems to be a bug related to the use of preset in the jest configuration. ref: https://youtrack.jetbrains.com/issue/IDEA-204229 .

christopher-johnson added a commit to ubleipzig/research-and-demos that referenced this issue Dec 14, 2018
christopher-johnson added a commit to ubleipzig/research-and-demos that referenced this issue Dec 14, 2018
christopher-johnson added a commit to ubleipzig/research-and-demos that referenced this issue Dec 14, 2018
@christopher-johnson
Copy link
Contributor Author

should note here also that the integration tests will stay where they are until cypress is introduced.

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

No branches or pull requests

2 participants