nodejs / nodejs/node

`node:test` Tests without callback should not be reported as ok

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

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

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

説明

Version

26.7.0

Platform

Subsystem

No response

What steps will reproduce the bug?
describe('two todos', () => {
  // TODO
  it('should handle first case', (t) => {
    t.todo();
  });

  // TODO
  it('should handle second case');
});

This would report as

ℹ tests 2
ℹ suites 1
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 1
How often does it reproduce? Is there a required condition?

Deterministic

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

A test with no body, thus that doesn't test anything, should not be reported as OK.

It usually indicates a test that's TODO, so the existing feature of reporting todos may be the most relevant option there, and I think (?) it would be non-breaking for existing test suites.

What do you see instead?

TODO/incomplete test reported as pass

Additional information

Hi there 👋

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

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

はじめの一歩

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

調査の方向性

まず、Node.js 26.7.0 で提供された node:test の describe/it の例を使って問題を再現し、その後、コールバックのないテストが node:test の実装とそのテストでどのように分類されるかを追跡します。空のテストが pass として報告されなくなり、期待される todo の動作と一貫して分類され、既存のテスト報告が維持されれば完了です。

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

評価

技術スタック
javascript, node.js
領域
testing-qa
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

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

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