Skip to content

[v4] Crash Cannot read property 'name' of null in detect-testing-library-utils getImportedUtilSpecifier #305

Closed
@epmatsw

Description

@epmatsw

One of our tests has some code that looks like:

(window as any).__THING = false;

This is causing a crash with Cannot read property 'name' of null.

Looking at getImportedUtilSpecifier, it calls getPropertyIdentifierNode and checks .name on it, even though that can return null. It looks like the root cause might be isExpressionStatement not handling TSAsExpression types.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions