Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Warning: The current testing environment is not configured to support act(...) #1336

Open
@viveleroi

Description

After updating from v15 to v16 of testing-library/react, I'm now getting this error in all of my tests - except the tests still pass just fine.

Warning: The current testing environment is not configured to support act(...)

The error goes away when I downgrade to v15. Since @testing-library/dom is now a peer dep, I tried installing that as well but the error remains.

  • @testing-library/react version: 16
  • Testing Framework and version: vitest, @testing-library/jest
  • DOM Environment: jsdom 23.2.0, and I've tried upgrading this too. no change

With v15, here's what yarn why says (no warnings about act):

yarn why @testing-library/dom
β”œβ”€ @storybook/testing-library@npm:0.1.0
β”‚ └─ @testing-library/dom@npm:8.20.1 (via npm:^8.3.0)
β”‚
β”œβ”€ @testing-library/react@npm:15.0.7
β”‚ └─ @testing-library/dom@npm:10.1.0 (via npm:^10.0.0)
β”‚
└─ @testing-library/react@npm:15.0.7 [7cdc2]
 └─ @testing-library/dom@npm:10.1.0 (via npm:^10.0.0)

In 16 with dom added, here's what why says (warnings on act):

β”œβ”€ @storybook/testing-library@npm:0.1.0
β”‚ └─ @testing-library/dom@npm:8.20.1 (via npm:^8.3.0)
β”‚
└─ tatsu@workspace:.
 └─ @testing-library/dom@npm:10.1.0 (via npm:^10.1.0)

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

        AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /