[Bug]: `.resolves.not` and `.rejects.not` pass when a promise settles the wrong way
Maintainer thường phản hồi trong vòng 1 ngày
@microsoft-playwright-automation đang làm issue này rồi.
Từ ngày 24/11/2026.
- #44335 của @microsoft-playwright-automation — đang mở
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js, typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 100k
- Fork
- 6.9k
- Merge trung bình
- 16 giờ 18 phút
- Pull request đã merge (30 ngày)
- 281
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/playwright
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/playwright#44340 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Có thể đã có người làm @lazerg đã nhận 2 ngày trước. Đang mởagent-triage-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/playwright#44289 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: expose per-project workers on FullProject for reportersCó thể đã có người làm @microsoft-playwright-automation đã nhận hôm nay. Đang mởagent-triage-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/playwright#44264 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Test runner captures and source-maps stacks that it never usesCó thể đã có người làm @microsoft-playwright-automation đã nhận hôm nay. Đang mởagent-triage-done
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
microsoft/playwright#44334 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Skip PNG decode and diff when a screenshot matches its baseline byte for byteCó thể đã có người làm @microsoft-playwright-automation đã nhận hôm nay. Đang mởagent-triage-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
microsoft/playwright#44333 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/playwright
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
primer/primitives#1426 ·
-
Sign-in-only setup dialog describes API-key verificationCó thể đã có người làm @roboclaw-bot đã nhận hôm nay. Đang mởclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
openclaw/openclaw#204323 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
virtue-initiative/virtue-initiative#953 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
fumicode/bublys-org#261 ·
Maintainer thường phản hồi trong vòng 12 ngày