nodejs / nodejs/node

test_runner: todo/skip/expectFailure are truthy per docs, but implementation is otherwise

オープン
#61,815 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

never-stale
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

Version

v25.6.1

Subsystem

node:test

What steps will reproduce the bug?

Add the todo, skip or testFailure option to a test, setting it to an empty string. The result will be the same as if you set it to true or a non-empty string.

What is the expected behavior? Why is that the expected behavior?

Unsure whether the bug is in the code or in the API docs.

The code clearly does not treat these options as truthy:
https://github.com/nodejs/node/blob/2de34822cc9a19621a663e3f22b00b9a01697635/lib/internal/test_runner/test.js#L639-L641

But the docs specifically state they should be:

https://github.com/nodejs/node/blob/2de34822cc9a19621a663e3f22b00b9a01697635/doc/api/test.md?plain=1#L1691-L1696

Additional information

Previous discussions:

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

lib/internal/test_runner/test.js の 639-641 行付近と、doc/api/test.md の 1691-1696 行付近にあるオプションの説明から始めてください。空文字列を有効として扱うべきか、それともドキュメントが誤っているのかを判断するため、リンクされた議論を確認してください。ドキュメントと実装が一致し、空、true、空でない値を対象とするカバレッジがあれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, node.js
領域
testing-qa
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。