[Bug]: `.resolves.not` and `.rejects.not` pass when a promise settles the wrong way
メンテナーはふだん 1 日以内に返信
@microsoft-playwright-automation がすでに取り組んでいます。
2026年11月24日 から。
- #44335 @microsoft-playwright-automation による — オープン
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js, typescript
- 領域
- testing
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 100k
- フォーク
- 6.9k
- 平均マージ
- 16時間 18分
- マージ済み PR(30日)
- 281
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/playwright のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/playwright#44340 ·
メンテナーはふだん 1 日以内に返信
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)対応中かも @lazerg が 2 日前に担当しました。 オープンagent-triage-done
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoft/playwright#44289 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: expose per-project workers on FullProject for reporters対応中かも @microsoft-playwright-automation が今日担当しました。 オープンagent-triage-done
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/playwright#44264 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: Test runner captures and source-maps stacks that it never uses対応中かも @microsoft-playwright-automation が今日担当しました。 オープンagent-triage-done
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
microsoft/playwright#44334 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: Skip PNG decode and diff when a screenshot matches its baseline byte for byte対応中かも @microsoft-playwright-automation が今日担当しました。 オープンagent-triage-done
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
microsoft/playwright#44333 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/playwright の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sindresorhus/eslint-plugin-unicorn#4045 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
CreadorLanda/yo#316 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
awslabs/social-messaging-agent-runtime-toolkit#232 ·
メンテナーはふだん 3 日以内に返信
-
bug p2 platform:linux platform:macos platform:windows triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信