Skip to content

Provide a better experience with lifecycle hooks #1249

Closed
@timdeschryver

Description

@timdeschryver

@MatanBobi (and @timdeschryver, if you're still interested in Angular's implementation), it seems like this change could potentially run the risk of cluttering the logs for developers who intentionally aren't using the automatic cleanup functions. (For example, I'm using vitest, which by default doesn't have globals enabled. But I'm sticking with Vitest's defaults intentionally.) Particularly, this warning will be logged for every single test file that tests React components.

Is it possible to only display this warning once per call to jest/vitest/etc.? For instance, is there a way that an ENV var (e.g., *TL_GLOBAL_WARNING_LOGGED) could be set (which only lasts the lifetime of npx jest, npx vitest, etc.)? Or maybe something else would be possible?

Originally posted by @ITenthusiasm in #1244 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions