testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.26k stars 466 forks source link

[v10.3.0] ReferenceError: process is not defined #1322

Closed lacolaco closed 1 month ago

lacolaco commented 1 month ago

Relevant code or config:

getByRole('link', { name: "missing query" });

What you did:

I wrote a spec which throws an error by getByXXX and ran on a browser.

What happened:

Since #1321, DTL cannot report an assertion error with DOM element due to illegal access to process.

https://github.com/testing-library/dom-testing-library/pull/1321

diff between v10.3 and v10.2.

Until v10.2.0, typeof process !== "undefined" has been prevented this situation.

Reproduction:

Problem description:

Suggested solution:

github-actions[bot] commented 1 month ago

Uh oh! @lacolaco, the image you shared is missing helpful alt text. Check your issue body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.