-
Notifications
You must be signed in to change notification settings - Fork 1.4k
add support for *.spec.js spec file naming #216
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
Conversation
Never seen it before. Can you link to something that proves your point?
👎 And where do you keep these |
|
A quick Google query popped out a few examples:
|
I personally keep them in the |
Ok, so it seems it's for marking something as a test when you have both the test and the actual code in the same directory. Not saying we won't accept this PR, but you are not doing this, so you really don't need the |
Yes, I've seen that a couple of times and even tried it. I've come to the conclusion that it is more practical to have spec files in a separate top-level folder. The real reason I keep using the suffix is mostly because it is possible to determine the type of a file (implementation/spec/mock) from its basename. |
@jankuca Aren't your test files run? I thought they should, because: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid the if condition, you could just do this:
.replace(/\.spec/, '')
.replace(/test\-/g, '')|
I am now wondering if it's not just easier to rename |
|
But for now, @sindresorhus and I think that this is an easy fix'n'win, so I guess we'll just merge this PR ;) |
|
@jankuca could you please fix the comments in this PR? |
|
@jankuca Never mind, I made the changes myself ;) |
|
Thanks! The reason I've put the |


This change adds support for
whatever.spec.jstest file names (in the context of prefixing test results by the CLI) which is a quite common practice really. The former logic which trimstest-prefixes stays in place.It might even make sense to include support for the
whateverSpec.jsvariation.