Skip to content

test: fix type errors from the @types/node 26 assert overloads - #29

Merged
webpro merged 1 commit into
webpro-nl:mainfrom
everton-dgn:test/assert-overload-types
Nov 19, 2026
Merged

webpro merged 1 commit into
webpro-nl:mainfrom
everton-dgn:test/assert-overload-types

Conversation

@everton-dgn

Copy link
Copy Markdown
Contributor

Since the dev dependency update in 306bef4, pnpm test:types fails on main, so the build job fails for every pull request. @types/node 26 splits the message parameter of assert.ok and assert.equal into two overloads: an optional Error or message function, and a required string. With @types/node 24.19.2 the same files typecheck.

  • test/positions.test.ts: a and item are passed to assert.ok inside the loop that declares them, and resolving the overload now feeds back into their inferred type (TS7022). They are annotated with the element types of Command["prefix"] and Case["items"].
  • test/substitution-boundaries.test.ts: result.stderr || result.error?.message is string | undefined, which matches neither overload. The message now falls back to the exit status.

Only these three test lines change. pnpm test:types, lint, formatting and the Node 24 suite (2,145 tests) pass.

@pkg-pr-new

pkg-pr-new Bot commented Nov 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/unbash@29

commit: d23f04f

@webpro

webpro commented Nov 19, 2026

Copy link
Copy Markdown
Member

Thanks, Éverton! Much appreciated.

@webpro
webpro merged commit f91ec17 into webpro-nl:main Nov 19, 2026
3 checks passed
@webpro

webpro commented Nov 22, 2026

Copy link
Copy Markdown
Member

🚀 This pull request is included in v6.0.5. See Release 6.0.5 for release notes.

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

Successfully merging this pull request may close these issues.

2 participants