Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@
"eslint-plugin-unicorn": "^57.0.0",
"expect-type": "1.2.1",
"globals": "16.3.0",
"jest": "30.0.4",
"jest": "30.2.0",

This comment was marked as outdated.

"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "30.0.4",
"jest-environment-jsdom": "30.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Jest Version Drift Causes Instability

The jest and jest-environment-jsdom packages were updated to 30.2.0, but babel-jest remains at 30.0.4 (line 201), creating a version mismatch within the Jest ecosystem. Jest packages from the same major version are designed to work together and should be kept in sync to avoid compatibility issues, test failures, or unexpected behavior during test execution.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Directly reassigning window.location in the afterEach hook of api.spec.tsx will throw a TypeError because JSDOM v26, introduced via the jest update, makes this property read-only.
Severity: HIGH

Suggested Fix

In the afterEach hook within static/app/api.spec.tsx, replace the direct assignment to window.location with a call to the existing setWindowLocation() helper function to restore the URL. Alternatively, remove the restoration logic entirely.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: package.json#L224

Potential issue: The update to jest introduces JSDOM v26, which makes the
`window.location` property read-only and non-configurable. In `static/app/api.spec.tsx`,
the `afterEach` hook for the `resolveHostname` test suite attempts to restore the
original location by directly reassigning `window.location`. This will now throw a
`TypeError: Cannot set property location of #<Window> which has only a getter` at
runtime, causing all tests within that suite to fail during the cleanup phase.

Did we get this right? 👍 / 👎 to inform future reviews.

"jest-fail-on-console": "3.3.1",
"jest-junit": "16.0.0",
"knip": "5.80.2",
Expand Down
Loading
Loading