Add testPath to suite in jest-jasmine2 reporter callbacks#5394
Add testPath to suite in jest-jasmine2 reporter callbacks#5394cpojer merged 3 commits intojestjs:masterfrom Vanuan:patch-1
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5394 +/- ##
==========================================
- Coverage 61.32% 61.31% -0.02%
==========================================
Files 205 205
Lines 6925 6927 +2
Branches 3 3
==========================================
Hits 4247 4247
- Misses 2677 2679 +2
Partials 1 1
Continue to review full report at Codecov.
|
|
Mind adding a test so we don't break it when removing jasmine? |
|
Ping @Vanuan Mind adding a test? |
|
Current tests already cover this code. Similar PR from @palmerj3 didn't have any additional tests so I don't know how to do it. Are you saying jasmine would be removed? I'd like to use it like this: const jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmineReporters.JUnitXmlReporter({
// Jest runs many instances of Jasmine in parallel.
// Force distinct file output
// per test to avoid collisions.
modifyReportFileName: function(name, suite) {
return `${suite.testPath.replace("/", "_")}-${name}`;
}
...Maybe there's a simpler way to safely write JUnit report files? |
|
We have a future goal (on the backburner for now) of removing jasmine, replacing it with For JUnit xml in particular, you can use https://www.npmjs.com/package/jest-junit. Might be that this PR in particular is related to their one open issue, though: https://github.com/palmerj3/jest-junit/issues/39 🙂 |
SimenB
left a comment
There was a problem hiding this comment.
Seeing as the other PR was merged without tests, we can probably merge this as well
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Add
testPathtojest-jasmine2reporter callbacks.Before:
After
Test plan
See #4594