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

discuss: all test file's name should end with _test.ts #273

Closed
axetroy opened this issue Mar 13, 2019 · 6 comments
Closed

discuss: all test file's name should end with _test.ts #273

axetroy opened this issue Mar 13, 2019 · 6 comments

Comments

@axetroy
Copy link
Contributor

axetroy commented Mar 13, 2019

In order to maintain the uniformity of the project style, the test file should end with _test.ts

This also helps the third-party library to detect whether it is a test file.

Other test-tools/plugins/extensions will definitely appear in the future.

So should files like this be renamed?

https://github.com/denoland/deno_std/blob/master/ws/test.ts
https://github.com/denoland/deno_std/blob/master/textproto/test.ts
https://github.com/denoland/deno_std/blob/master/testing/test.ts
https://github.com/denoland/deno_std/blob/master/testing/test.ts
https://github.com/denoland/deno_std/blob/master/media_types/test.ts
https://github.com/denoland/deno_std/blob/master/log/test.ts
...

Make it a de facto standard

Avoid naming confusion like the nodejs community

@j-f1
Copy link

j-f1 commented Mar 13, 2019

Perhaps mod_test.ts?

@zekth
Copy link
Contributor

zekth commented Mar 13, 2019

There was a discussion about it: #130
test.ts is the test file of the module itself

@axetroy
Copy link
Contributor Author

axetroy commented Mar 13, 2019

@zekth Already confirmed?

@j-f1 I prefer to {entry file}_test.ts. It seems that the entry file is not be mod.ts

@axetroy axetroy changed the title discuss: all test filename should end with _test.ts discuss: all test file's name should end with _test.ts Mar 13, 2019
@zekth
Copy link
Contributor

zekth commented Mar 13, 2019

Updated the style_guide for this.
ref: https://github.com/denoland/deno/pull/1918/files

But there was no mention of the module test file.

May be better to continue this discussion on: #130

@hayd
Copy link
Contributor

hayd commented Mar 14, 2019

I think the regex /(test|.+_test).ts/ is reasonable.

I don't think there's a huge point in talking about this until #193

@axetroy
Copy link
Contributor Author

axetroy commented Mar 14, 2019

It seems that this is not an urgent matter, so close it.

@axetroy axetroy closed this as completed Mar 14, 2019
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

4 participants