Skip to content

Upgrade chai to 6 and type packages, remove unused sinon - #33

Merged
dduugg merged 1 commit into
mainfrom
upgrade-chai-and-type-packages
Sep 30, 2026
Merged

dduugg merged 1 commit into
mainfrom
upgrade-chai-and-type-packages

Conversation

@dduugg

@dduugg dduugg commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Covers the rest of the grouped Dependabot PR #28, following #29 and #31. No source changes; only package.json and yarn.lock.

Changes

Package From To Notes
chai 4.5.0 6.2.2 ESM-only since chai 5
@types/chai 4.x 5.2.3 Latest published; chai 6 doesn't ship its own types
@types/node 22.19.17 24.19.0 Matches the extension host's Node, not the 26.x Dependabot proposed
@types/vscode 1.115.0 1.138.0 Lockfile only; range stays ^1.32.0
sinon, @types/sinon 19.x, 17.x removed Never imported
  • chai 6: the compiled tests are CommonJS, so they load ESM-only chai through require(esm). The tests run inside VS Code's extension host, which in VS Code 1.140 is Electron 43 with Node 24.21 and supports this. With one assertion deliberately broken, the run reported AssertionError: expected true to be false and exited 1, so chai 6 failures still fail CI.
  • @types/node 24, not 26: extension code runs on the extension host's Node 24. Types for 26 would let code compile against APIs that don't exist at runtime.
  • @types/vscode range kept at ^1.32.0: vsce package refuses to build when the @types/vscode range is higher than engines.vscode. So only the lockfile moves, as in Bump the npm group with 11 updates #28. vsce package still succeeds.
  • sinon removed: no test imports it. Removing it also drops one of the two paths to the low-severity diff 7.0.0 advisory (auto-dismissed as #40). The remaining path is through mocha, via @vscode/test-cli.

Testing

  • yarn install --frozen-lockfile, yarn run vscode:prepublish and yarn lint pass. All 13 tests pass locally.
  • vsce package builds successfully.
  • yarn audit shows 1 low-severity advisory, down from 2.

Worth deciding separately

engines.vscode is still ^1.32.0, but the type packages now describe VS Code 1.138 and Node 24. The compiler won't catch use of an API that older VS Code versions lack. This was already true with 1.115, but the gap is wider now. Raising engines.vscode would close it, at the cost of dropping support for older VS Code versions.

- chai 4 -> 6, with @types/chai 5. chai 5+ is ESM-only; the compiled
  CommonJS tests load it through require(esm), which the Node 24
  extension host in current VS Code supports.
- @types/node 22 -> 24, matching the Node version in the VS Code
  extension host (Electron 43, Node 24.21, as of VS Code 1.140).
  Dependabot proposed 26, which would type APIs the runtime lacks.
- @types/vscode 1.115 -> 1.138 in the lockfile. The ^1.32.0 range is
  kept: vsce refuses to package when the @types/vscode range exceeds
  engines.vscode.
- Remove sinon and @types/sinon. No test imports sinon, and dropping it
  removes one of the two dependency paths to diff 7.0.0.
@dduugg
dduugg requested a review from a team as a code owner September 30, 2026 18:18
@github-project-automation github-project-automation Bot moved this to Triage in Modularity Sep 30, 2026
@dduugg
dduugg merged commit ebe6a89 into main Sep 30, 2026
7 checks passed
@dduugg
dduugg deleted the upgrade-chai-and-type-packages branch September 30, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant