Skip to content

chore(deps-dev): bump jsdom from 30.1.3 to 31.0.1 - #438

Merged
kevinccbsg merged 1 commit into
mainfrom
chore/jsdom-31
Nov 16, 2026
Merged

kevinccbsg merged 1 commit into
mainfrom
chore/jsdom-31

Conversation

@kevinccbsg

Copy link
Copy Markdown
Member

Supersedes #428, which had lockfile conflicts with main after #430 and #437. This bumps straight to 31.0.1, the latest release.

What broke

jsdom 31 rewrote CSS parsing and computed styles, and now substitutes custom properties in getComputedStyle, as browsers do. Four sidebar tests compared computed styles against the literal var(--twd-...) text. With no theme injected, the variables were undefined and resolved to fallback values:

- color: var(--twd-success);
- fontWeight: var(--twd-font-weight-bold);
+ color: rgb(0, 0, 0);
  • src/tests/ui/logItem.spec.tsx: assertion passed / test failed log styles
  • src/tests/ui/testListItem.spec.tsx: depth indentation, log styles

This is a test-only issue. No runtime code changes.

Fix

Both specs now call injectTheme() in beforeAll and assert against defaultTheme values (success, error, fontWeightBold, spacingSm). They now check the color actually rendered instead of the variable name. Verified that they can fail: expecting defaultTheme.error on a passed log fails with rgb(34, 197, 94) vs rgb(255, 82, 82).

Other breaking changes in jsdom 31

  • Engines: ^22.22.2 || ^24.15.0 || >=26.0.0. The CI matrix runs the latest 22, 24 and 26, and jsdom is a devDependency, so the >=20 engines for consumers are unaffected (node-compat covers that).
  • Canvas backend moved to @napi-rs/canvas: not used here.
  • Parsing can pause at blocking scripts: tests render through Testing Library, not the JSDOM constructor.

Verification

  • Vitest: 544 tests pass.
  • ESLint and Prettier pass.
  • Lockfile: no @emnapi entries dropped. The removed packages (@csstools/*, css-tree, @asamuzakjp/*) are the CSS libraries jsdom replaced with its integrated implementation.

jsdom 31 rewrote CSS handling and now substitutes custom properties in
computed styles, as browsers do. Four sidebar tests compared computed
styles against the literal var(--twd-...) text and, with no theme injected,
got the fallback values (rgb(0, 0, 0), 0px, 400) instead.

The LogItem and TestListItem specs now inject the theme in beforeAll and
assert against defaultTheme values, so they check the color actually
rendered rather than the variable name. No runtime code changes.

Supersedes #428, which conflicted with the lockfile on main.
@kevinccbsg
kevinccbsg merged commit ef8ce09 into main Nov 16, 2026
10 checks passed
@kevinccbsg
kevinccbsg deleted the chore/jsdom-31 branch November 16, 2026 17:29
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.

1 participant