chore: regression test for @types/node AbortSignal/AbortController merge (#34555)
## Summary
Regression test for
[#19527](https://github.com/denoland/deno/issues/19527): when
`npm:@types/node` is loaded alongside Deno's `lib.deno.web.d.ts`, the
`AbortSignal` produced by `new AbortController()` must remain assignable
to the `AbortSignal` parameter of `@types/node` APIs
(`node:fs.writeFile`, `node:timers/promises`,
`node:events.addAbortListener`, …).
This is currently handled by `TYPES_NODE_IGNORABLE_NAMES` in
`cli/tsc/mod.rs`, which causes the TypeScript fork to drop
`@types/node`'s redeclarations of these globals so Deno's stay
canonical. The bundled `cli/tsc/dts/node/globals.d.cts` is also
pre-stripped of `declare var AbortController`/`AbortSignal` for the same
reason. The issue's original reproduction (`writeFile("file.txt",
"content", { signal }, cb)`) currently checks cleanly, but until now
nothing protected that.
- Adds the original repro to `tests/specs/npm/compare_globals/main.ts`,
which already runs `--check=all` against real `npm:@types/node`. A
TS2300/TS2320 regression in the merge logic would fail the test.
- Also asserts that `AbortSignal` keeps extending `EventTarget` (the
TS2320 from the issue) and that `AbortSignal.timeout(0)` resolves to the
canonical `AbortSignal` (not a `@types/node` shadow).
- Documents in `cli/tsc/mod.rs` why `AbortController`/`AbortSignal` (and
friends) live in `TYPES_NODE_IGNORABLE_NAMES`, with a link to the issue.
Verified by checking the new module with `npm:@types/node@24.2.0` and
`@18` — both pass.
Closes denoland/orchid#302
## Test plan
- [ ] `cargo test --bin deno specs::npm::compare_globals` passes
- [ ] CI green
Co-authored-by: divybot <divybot@users.noreply.github.com>
Co-authored-by: Divy Srivastava <me@littledivy.com> E
em committed
f85f23c02136865b8c3a749e3becf233387d2b1e
Parent: 1250f76
Committed by GitHub <noreply@github.com>
on 5/30/2026, 5:37:13 AM