Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,336 8 commenti 9 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, react
Ambito
testing-qa

Direzione di ricerca

Riproduci l’avviso con @testing-library/react 16 in Vitest, @testing-library/jest e jsdom 23.2.0, quindi confrontalo con 15.0.7 e con gli alberi delle dipendenze di @testing-library/dom elencati. Non sono indicati file sorgente né test; il lavoro è completato quando viene identificata e verificata una correzione che rimuove l’avviso mantenendo i test superati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)
Lingua principale
JavaScript
Stelle
19.7k
Fork
1.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di testing-library/react-testing-library

Tutte le issue di testing-library/react-testing-library

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.