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
Default test file name: foo_test.ts or foo.test.ts ? #2947
Comments
For comparison here's list of glob that AVA matches
|
I've always kept them seperate, in |
Yep I also personally prefer the
|
Similar to ava, the coverage tool istanbul considers the following patterns as test scripts and excludes them from coverage reports by default:
These don't include |
The JS community normally uses dash case for files, Deno uses snake case internally. Either one would look strange here. This is side-stepped by By the way, are we open to switching to dash case for TS files...? |
For a |
The reason that the React community uses I find that my tests in Node end up being a little different, since Node projects have a variety of purposes and architectures. For example, if my project is a real-world web app, the tests for my route handlers often need an actual server, database, seed data, etc. Colocating all of this extra stuff alongside my actual API feels much more messy, as does importing them from far away. So instead of having |
The patterns |
I think there are two distinct questions here:
I don't have an opinion on 1. but for 2. I think that the test runner needn't enforce whatever choice is made. (I don't see a downside to having a large glob.) |
Is there a decision on this? After going through the comments, It'll be easier to rename test files now, as more tests will be added as deno matures. |
Deno now automatically discovers test file with following names:
Both patterns from original comment are covered, so I think we can close this issue. |
foo_test.ts comes from Google Python style.
foo.test.ts seems to be used in the React community.
The test runner will have this hardcoded into it, I think it would make sense to have a small debate about which is better.
The text was updated successfully, but these errors were encountered: