Do you want to request a feature or report a bug?
Feature / Question
What is the current behavior?
Not sure if this is the best place, but currently we can get the result programmatically via --json flag. The problem is when I try to integrate this to phabricator to collect code coverage, phabricator expects the coverage to have a specific format (for example NNNNNCCCNNNNNNNNCCCCCCNNNUUUNNNNN) as described here https://secure.phabricator.com/book/phabricator/article/arcanist_coverage/, but the json output cannot produce that out of the box. It outputs an object with statementMap, branchMap, etc inside the coverage property
Here's the current JSON output
{
"testResults": [
{
"name": "/path/to/test/file",
"coverage": {
"/path/to/file/": {
"path": "/path/to/file",
"statementMap": {},
"branchMap": {}
}
}
}
]
}
What is the expected behavior?
Considering I heard FB also uses phabricator, do you think it's possible to support those custom format out of the box?
Here's the proposed JSON output
{
"testResults": [
{
"name": "/path/to/test/file",
"coverage": {
"/path/to/file/": "NNCCCNNNNNNNNCCCCC"
}
}
]
}
Thanks :)
@kentaromiura is actually about to open source the code we use for coverage in phabricator at FB soon.
@ide who might care. This is super useful during code review.
Example:

@cpojer good UI. Let鈥檚 change it by default. And move HTML page to coverage/ (right now it is on subdir) for better UX.
@ai this is not for the coverage html output. This is for phabricator integration: https://www.phacility.com/
@cpojer oops :(. Should I create issue with little HTML coverage tweaks? Or it is not so important?
the HTML coverage report is coming from istanbul, not from Jest: https://github.com/istanbuljs
We open sourced jest-phabricator-coverage with Jest 19. Feel free to use it as testResultsProcessor.
Most helpful comment
@kentaromiura is actually about to open source the code we use for coverage in phabricator at FB soon.
@ide who might care. This is super useful during code review.