Skip to content

fix(jest-mock): use Symbol from environment global#15858

Merged
SimenB merged 7 commits intojestjs:mainfrom
anion155:patch-1
Dec 12, 2025
Merged

fix(jest-mock): use Symbol from environment global#15858
SimenB merged 7 commits intojestjs:mainfrom
anion155:patch-1

Conversation

@anion155
Copy link
Copy Markdown
Contributor

@anion155 anion155 commented Oct 9, 2025

Summary

Symbol.dispose used here is different from the one that is used in tests, as the consequence polyfilled in setupFiles (I'm not sure why there is no Symbol.dispose in context of the test files, but that's how it works for me) dispose symbol differs from the one used by jest-mock

Test plan

it.only("should rethrow action error", async () => {
  using errorSpy = jest.spyOn(console, "error").mockImplementation(() => {});
  console.error("Test")
  expect(errorSpy.mock.calls).toStrictEqual([
    ["Test"],
  ]);
});

@netlify
Copy link
Copy Markdown

netlify bot commented Oct 9, 2025

Deploy Preview for jestjs ready!

Name Link
🔨 Latest commit 7d96a65
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/693bd9b5169fe800088cfb37
😎 Deploy Preview https://deploy-preview-15858--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Oct 9, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Oct 9, 2025

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@15858

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@15858

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@15858

create-jest

npm i https://pkg.pr.new/create-jest@15858

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@15858

expect

npm i https://pkg.pr.new/expect@15858

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@15858

jest

npm i https://pkg.pr.new/jest@15858

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@15858

jest-circus

npm i https://pkg.pr.new/jest-circus@15858

jest-cli

npm i https://pkg.pr.new/jest-cli@15858

jest-config

npm i https://pkg.pr.new/jest-config@15858

@jest/console

npm i https://pkg.pr.new/@jest/console@15858

@jest/core

npm i https://pkg.pr.new/@jest/core@15858

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@15858

jest-diff

npm i https://pkg.pr.new/jest-diff@15858

jest-docblock

npm i https://pkg.pr.new/jest-docblock@15858

jest-each

npm i https://pkg.pr.new/jest-each@15858

@jest/environment

npm i https://pkg.pr.new/@jest/environment@15858

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@15858

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@15858

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@15858

@jest/expect

npm i https://pkg.pr.new/@jest/expect@15858

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@15858

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@15858

@jest/globals

npm i https://pkg.pr.new/@jest/globals@15858

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@15858

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@15858

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@15858

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@15858

jest-message-util

npm i https://pkg.pr.new/jest-message-util@15858

jest-mock

npm i https://pkg.pr.new/jest-mock@15858

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@15858

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@15858

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@15858

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@15858

jest-resolve

npm i https://pkg.pr.new/jest-resolve@15858

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@15858

jest-runner

npm i https://pkg.pr.new/jest-runner@15858

jest-runtime

npm i https://pkg.pr.new/jest-runtime@15858

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@15858

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@15858

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@15858

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@15858

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@15858

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@15858

@jest/transform

npm i https://pkg.pr.new/@jest/transform@15858

@jest/types

npm i https://pkg.pr.new/@jest/types@15858

jest-util

npm i https://pkg.pr.new/jest-util@15858

jest-validate

npm i https://pkg.pr.new/jest-validate@15858

jest-watcher

npm i https://pkg.pr.new/jest-watcher@15858

jest-worker

npm i https://pkg.pr.new/jest-worker@15858

pretty-format

npm i https://pkg.pr.new/pretty-format@15858

commit: d63fdd5

@anion155 anion155 changed the title fix: use Symbol from environment global fix(jest-mock): use Symbol from environment global Oct 9, 2025
@SimenB
Copy link
Copy Markdown
Member

SimenB commented Oct 10, 2025

Can you add a test as well?

@anion155
Copy link
Copy Markdown
Contributor Author

Can you add a test as well?

I suppose using syntax isn't fully supported in ci/cd

@anion155
Copy link
Copy Markdown
Contributor Author

@SimenB ping

Copy link
Copy Markdown
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks!

@SimenB SimenB merged commit ad565c5 into jestjs:main Dec 12, 2025
8 of 9 checks passed
@anion155 anion155 deleted the patch-1 branch December 12, 2025 10:44
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants