Open rushikeshpatangrao opened 2 years ago
Test Explorer should list down parameterized tests independently and run them correctly
Test explorer only shows and runs the first test and it also breaks when you try to include parameters in the test name.
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
Same issue here.
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.
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.
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
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,
then the test fails in test explorer and test explorer doesn't show it correctly