winterbe / jest-teamcity-reporter

Teamcity Reporter for Jest Unittest Results
https://www.npmjs.com/package/jest-teamcity-reporter
Other
50 stars 23 forks source link

Usage of title instead of fullName for test case results #23

Closed matmalkowski closed 5 years ago

matmalkowski commented 6 years ago

Hey,

I've noticed in our CI that number of tests reported by TeamCity is different than number of tests reported when running them on your local, and the reason is I believe that TC is overriding the results for duplicated names of the tests?

So if there are 2 tests suites:

describe('Component A', () => {
  describe('in default variant', () => {
    it('renders correctly', () => {})
  });
  describe('in complex variant', () => {
    it('renders correctly', () => {})
  })
});

Local run will report 2 tests, while for TeamCity it seems to be picked up as 1 test (as the name being used is renders correctly without the describe prefixes.

This issue could be solved if we would start using fullName instead of current title field from testResult.

Any thoughts @winterbe ? I Could create a PR if that's a correct way of addressing this issue

lukebarton commented 5 years ago

I think you just need to upgrade your version of jest-teamcity-reporter because:

https://github.com/winterbe/jest-teamcity-reporter/blob/master/index.js#L34

winterbe commented 5 years ago

This is right. I close this issue due to inactivity.