Skip to content

Conversation

ThomasRooney
Copy link
Collaborator

@ThomasRooney ThomasRooney commented May 13, 2018

Two tests with the same name (e.g. in different describe blocks) currently get the decorator of the last test result.

This is bad behaviour, as its common practice when testing an API under different conditions, to have the scenario be in the describe block and the API method under test in the test block. I.e. its a valid scenario to have multiple test blocks with the same key.

This adjusts that behaviour, by using the line numbers of the test under KnownFail scenarios to assign the decorators correctly, or otherwise just using the first Success or Unknown case (as they have the same parsed test result anyway -- line numbers being only available in KnownFail scenario).

@coveralls
Copy link

coveralls commented May 13, 2018

Pull Request Test Coverage Report for Build 366

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 74.426%

Files with Coverage Reduction New Missed Lines %
src/TestResults/TestResultProvider.ts 2 95.08%
Totals Coverage Status
Change from base Build 363: 0.05%
Covered Lines: 573
Relevant Lines: 737

💛 - Coveralls

@orta
Copy link
Member

orta commented May 13, 2018

Another fabulous PR, great job - I've sent you an invite to admin this repo.

I'll get these shipped.

@orta orta merged commit 4fd84d4 into jest-community:master May 13, 2018
@orta
Copy link
Member

orta commented May 13, 2018

Shipped as 2.7.2

legend1202 pushed a commit to legend1202/vscode-jest that referenced this pull request Jun 18, 2023
…with-same-name

Fix tests with same name corrupting the decorator dots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants