-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
having --test
and --test-only
flags increase prototyping time
#47945
Comments
I do agree the DX is currently not great. Implementing this feature would require a large change in how the test runner runs tests, and would have some performance penalty.
if we would want to detect I am not saying this isn't possible - but it probably a has significant performance cost, especially when running more than a single file. |
I'm also strongly -1 to a solution that would come with a performance hit because "only" tests are not the common case. While needing the extra CLI argument is not the most ideal (but is also used by at least one other popular test runner), it makes it more difficult to accidentally bork your test suite by checking in |
what if --test-only will run everything if no |
You have to do a pass over all of the possible tests to know if it was found or not. That's what @MoLow was saying in #47945 (comment). |
yes I saw but we can pass twice instead of building the tree, and it will be a much easier solution if it's not common enough |
so you suggest |
performance penalty can be solved later, but it makes it really hard to do some prototyping, first adoption is needed |
I don't think that this is something we can do. Not only would it be a breaking change, but it would be extremely confusing DX - far worse than asking to specify another CLI flag.
I'm not so sure about this statement either. I don't think we can assume that this will just get figured out. If we had a plan, but not an implementation, that would be different. Yes, we could opt into a slower mode when |
the design restrictions I described are inherent. I think it can be mathematically proven that "performance penalty cannot be solved later" |
I'm going to close this, but anyone is welcome to create a prototype with benchmark numbers. |
--test
and --test-only
flags reduce prototyping time--test
and --test-only
flags increase prototyping time
What is the use case for the Node version of The use case in other major test frarmeworks is clear: I have 50 tests of one function, and I (temporarily) only want to see the output from one test, so I mark it as If Node's version can't serve that use case, who does it serve? |
P.S. As far as performance, I'm curious how Mocha (see https://mochajs.org/#exclusive-tests), Jest (https://jestjs.io/docs/api#describeonlyname-fn), etc. all solved this same problem: surely Node's test runner that fundamentally different from all others? |
reopening this since as time passes, I hear more people needing this and I do think it might be worth the penalty. |
@MoLow please provide benchmarks. |
It is unfriendly to not have the convenience of executing single tests without having to change code. Every other test framework worth it's salt allows for this somehow. The performance penalty vs. the user pain of not being able to execute no more than what you want is not a good argument in my mind. My purely non scientific experience tells me that With that in mind adding a small pre-test-scan phase to collect all the test names (along with tracking a hierarchical naming convention) when a filtering argument is passed make sense to me (user opting into the cost of the pre-test-scan, I think users could stomach this). Additionally, even today with Finally, the reporters are noisy as heck when using It should be obvious from the fact that the pattern argument was passed that we don't care to know that non-matching tests were skipped. Sure, if there are matching tests that were skipped because they were programmatically declared to be, then fine. The point is that I can't adopt I urge the developers to take these things into consideration. Thanks. |
I want
|
I've been using node's test runner for a bit now and this is a legitimate pain point. It would be more developer friendly if the default had the |
We are interested in having an option to run all tests in the same process. See #51579. Once that PR is merged, I think it will be possible to only require |
What is the problem this feature will solve?
part of the development and testing flow I add and remove
.only
.The need to change the command each time makes testing and prototyping much slower and prevents you from using
--watch
commandWhat is the feature you are proposing to solve the problem?
Only have
--test
and in case there isonly
execute only those testsWhat alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: