-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Revert "test_runner: change ts default glob" #58202
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
Revert "test_runner: change ts default glob" #58202
Conversation
Review requested:
|
What do you think? @JakobJingleheimer, @marco-ippolito |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58202 +/- ##
==========================================
- Coverage 90.14% 90.12% -0.02%
==========================================
Files 629 629
Lines 186634 186634
Branches 36616 36621 +5
==========================================
- Hits 168236 168201 -35
- Misses 11204 11215 +11
- Partials 7194 7218 +24
🚀 New features to boost your workflow:
|
Currently all the release line supporting typescript follow the same behavior. |
That's not the case, all release lines do not follow the same behavior. With the following structure: ├── src
│ ├── dates.ts
│ ├── strings.ts
│ ├── tests
│ │ ├── dates.test.ts
│ │ ├── strings.test.ts
├── package.json
├── tsconfig.json And with {
"scripts": {
"test": "node --experimental-strip-types --test"
}
} Running ℹ tests 53
ℹ suites 20
ℹ pass 53
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 175.004645 Running ℹ tests 0
ℹ suites 0
ℹ pass 0
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 15.541625 |
That's the opportunity, to make the good defaults. Weird, that you consider this breaking, you should have considered #56350 breaking then. It will be even more painful, if we do it later. And again, I don't understand why someone would transpile their TypeScript test files, if they can execute them directly. And even if they do, they will at least be executed, and the only "bad thing", the tests will be included twice, whereas, I assume most people, would want to execute their test files, it will be ignored which is worst IMO, than executing twice (of course executing twice is also not the correct behavior), at least the tests runs. |
Apparently it has not been backported to v22 yet. I'm really not sure what to do 🤷 either way some use cases are gonna break pinging @nodejs/tsc |
I thought about it and I'm ok with reverting. It caused more trouble than it solved. |
This reverts commit 9df0ff7.
080797a
to
95d88b8
Compare
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
Added notable change because it was requested that we highlight this change since its a breaking change for people using experimental strip types |
Landed in 264cad7 |
Notable changes: doc: * add JonasBa to collaborators (Jonas Badalic) #58355 * add puskin to collaborators (Giovanni Bucci) #58308 fs: * (SEMVER-MINOR) add to `Dir` support for explicit resource management (Antoine du Hamel) #58206 test_runner: * Revert "test_runner: change ts default glob (Théo LUDWIG) #58202 PR-URL: #58406
Notable changes: doc: * add JonasBa to collaborators (Jonas Badalic) #58355 * add puskin to collaborators (Giovanni Bucci) #58308 fs: * (SEMVER-MINOR) add to `Dir` support for explicit resource management (Antoine du Hamel) #58206 test_runner: * Revert "test_runner: change ts default glob (Théo LUDWIG) #58202 PR-URL: #58406
TypeScript files glob for the test runner was added in #55081, and then changed in #57359. With this PR, I would like that we revert #57359, or at least open the discussion. Great default, and a runtime which just "work out of the box" is important, that's why changing the defaults matter.
Why should TypeScript files have different globs than JavaScript files?
It was already suggested that for v24.0.0, we remove this restriction of the test folder: #57359 (comment).
As we are approaching the stabilization of the TypeScript strip types feature, it is now or "never" (or only able to change that in semver major versions) to change the defaults, since it is still experimental for now, there is still time to do it.
Today, I wanted to try Node.js v24.0.0, and since v24 obviously include everything from v23 and v23 includes #57359, I was surprised that my tests were ignored (upgrading from v22).
#57359 (comment)
Why should people transpile test files, if it's possible to run them without transpiling thanks to that strip types feature? (I indeed keep my TypeScript files under a
src
folder).