Skip to content

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

Closed
@lacolaco

Description

@lacolaco
  • @testing-library/dom version: v10.3.0
  • Testing Framework and version: Angular Testing Library v17.0.0
  • DOM Environment: Karma (Chrome)

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.

#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:

  • Add typeof guard before accessing process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions