Jest parameterized tests doesn't run correctly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
- Ambito
- devtools, testing-qa
Direzione di ricerca
Riproduci il problema di app.test.js in un progetto Visual Studio Test Explorer usando i casi di test parametrizzati Jest elencati. Inizia esaminando come Test Explorer individua ed esegue questi test; il lavoro è terminato quando ogni caso parametrizzato è elencato ed eseguito in modo indipendente, inclusi i test con nomi parametrizzati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Expected Behavior
Test Explorer should list down parameterized tests independently and run them correctly
Actual Behavior
Test explorer only shows and runs the first test and it also breaks when you try to include parameters in the test name.
- NTVS Version: 1.5.40404.3
- Visual Studio Version: 2022
- Node.js Version: 16.15.1
Steps to Reproduce
- Create a new project using docs : https://docs.microsoft.com/en-us/visualstudio/javascript/tutorial-create-react-app?view=vs-2022
- In app.test.js, added a parameterized jest test.
test.each([
[true, true],
[false, false]
])('dummy test', (a, b) => {
expect(a).toBe(b);
});
-
When I build the project and open test explorer, it was expected to show two tests, but shows a single one

-
If I change the test to something which is expected to fail, like
test.each([
[true, true],
[false, true]
])('dummy test', (a, b) => {
expect(a).toBe(b);
});
The test explorer shows that the test still passes, which is because it seems to only run the first test
- If I change the test name to be something parameterized,
test.each([
[true, true],
[false, false]
])('expect %p to be %p', (a, b) => {
expect(a).toBe(b);
});
then the test fails in test explorer and test explorer doesn't show it correctly

- Lingua principale
- C#
- Stelle
- 1.8k
- Fork
- 355
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/nodejstools
-
microsoft/nodejstools#2523 · 1 reazione · 1 assegnatario ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
microsoft/nodejstools#2519 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
microsoft/nodejstools#2517 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
microsoft/nodejstools#2514 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
microsoft/nodejstools#2513 · 5 commenti ·
Tutte le issue di microsoft/nodejstools
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
lay295/TwitchDownloader#1675 ·
-
copilot documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
space-wizards/RobustToolbox#7119 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 4 giorni
-
.NET Bug Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-dotnet#5666 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni