Jest parameterized tests doesn't run correctly
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- devtools, testing-qa
Research direction
Reproduce the issue from app.test.js in a Visual Studio Test Explorer project using the listed Jest parameterized cases. Start by examining how Test Explorer discovers and runs these tests; done means each parameterized case is listed and executed independently, including tests with parameterized names.
Written by the indexing model from the issue text.
Description
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

- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nodejstools
-
microsoft/nodejstools#2523 · 1 reaction · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/nodejstools#2519 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
microsoft/nodejstools#2517 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
microsoft/nodejstools#2514 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/nodejstools#2513 · 5 comments ·
All issues in microsoft/nodejstools
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·