[Bug]: `.resolves.not` and `.rejects.not` pass when a promise settles the wrong way
I maintainer di solito rispondono entro 1 giorno
@microsoft-playwright-automation ci sta già lavorando.
Dal 24/11/2026.
- #44335 di @microsoft-playwright-automation — aperta
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js, typescript
- Ambito
- testing
Direzione di ricerca
Start by running the two-test reproduction repo; it shows the two assertions that wrongly pass. Since this is a regression between 1.56.1 and 1.64.1, bisect Playwright tags in that range to find the commit that changed how .resolves/.rejects handle a promise settling the wrong way, then read the matcher code around that diff. Done means both assertions fail with the usual 'Received promise rejected instead of resolved' and 'Received promise resolved instead of rejected' errors, the matching tests under the package's test directory pass, and .not still negates only the matcher.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
1.65.1
Steps to reproduce
Clone the two-test reproduction, then run npm install and npm test. No browser installation is needed.
The two assertions are in separate tests:
await expect(Promise.reject(new Error('request failed'))).resolves.not.toBe('cached');
await expect(Promise.resolve('saved')).rejects.not.toThrow('timeout');
Expected behavior
Both tests should fail. The first promise rejects, so .resolves has no value to compare. The second fulfills, so .rejects has no rejection reason to match. Adding .not should only negate the matcher after the promise settles the expected way. This follows the documented behavior of .resolves and .rejects.
Actual behavior
The runner reports 2 passed and exits with status 0. Removing only .not from both assertions produces the expected errors: Received promise rejected instead of resolved and Received promise resolved instead of rejected.
Additional context
The same two tests fail as expected on 1.56.1. Both pass on 1.64.1, 1.65.1, and 1.66.0-alpha-2026-11-23.
Environment
OS: Debian GNU/Linux 13 (trixie), x64, Linux 6.18
Node.js: 24.22.3
npm: 11.19.1
@playwright/test: 1.65.1
- Lingua principale
- TypeScript
- Stelle
- 100k
- Fork
- 6.9k
- Merge medio
- 16h 18m
- PR unite (30g)
- 281
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/playwright
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/playwright#44340 ·
I maintainer di solito rispondono entro 1 giorno
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Forse già presa @lazerg l’ha presa 2 giorni fa. Apertaagent-triage-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microsoft/playwright#44289 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: expose per-project workers on FullProject for reportersForse già presa @microsoft-playwright-automation l’ha presa oggi. Apertaagent-triage-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/playwright#44264 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Test runner captures and source-maps stacks that it never usesForse già presa @microsoft-playwright-automation l’ha presa oggi. Apertaagent-triage-done
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
microsoft/playwright#44334 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Skip PNG decode and diff when a screenshot matches its baseline byte for byteForse già presa @microsoft-playwright-automation l’ha presa oggi. Apertaagent-triage-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 30/100
microsoft/playwright#44333 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/playwright
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
primer/primitives#1426 ·
-
Sign-in-only setup dialog describes API-key verificationForse già presa @roboclaw-bot l’ha presa oggi. Apertaclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
openclaw/openclaw#204323 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
virtue-initiative/virtue-initiative#953 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
fumicode/bublys-org#261 ·
I maintainer di solito rispondono entro 12 giorni