test runner (--test, node:test) subtest test context lack `.skip`, `.only` and `.todo` functions
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
Version
20.7.0
Platform
Linux void-desktop 6.5.9_1 #1 SMP PREEMPT_DYNAMIC Thu Oct 26 12:11:50 UTC 2023 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
const test = require('node:test');
test('Parent', t => {
t.test.only('Child only', () => {});
t.test.skip('Child skip', () => {});
t.test.todo('Child todo', () => {});
});
Run with node --test <file> (same result without the --test flag)
How often does it reproduce? Is there a required condition?
Consistently
What is the expected behavior? Why is that the expected behavior?
All functions work as described here: https://nodejs.org/docs/latest-v20.x/api/test.html#subtests
This method behaves identically to the top level test() function. The following example demonstrates the creation of a top level test with two subtests.
What do you see instead?
TypeError [Error]: t.test.todo is not a function
TypeError [Error]: t.test.skip is not a function
TypeError [Error]: t.test.only is not a function
Additional information
These functions work for top-level test, they don't work for nested tests.
Maybe it doesn't make sense to expose those functions for subtests (use just describe - maybe it's enough), but in that case the documentation is misleading
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne am node:test-Untertest-API-Einstiegspunkt und reproduziere den bereitgestellten verschachtelten Test mit node --test oder ohne das Flag. Vergleiche das dokumentierte Verhalten von t.test.only, t.test.skip und t.test.todo mit den beobachteten TypeErrors; abgeschlossen ist die Aufgabe, wenn das Verhalten der verschachtelten API und die Dokumentation hinsichtlich des beabsichtigten Verhaltens übereinstimmen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js
- Bereich
- testing
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100