ctrf-io / ctrf-io/github-test-reporter
Use GitHub markdown diff syntax highlighting for assertion failures
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 376
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
It would be nice if assertion failures used syntax highlighting, to make them easier to read, especially when the output is long (e.g. assert.deepEqual).
The following markdown achieves this without changing the layout:
| Failed Tests |
|---|
❌ Test name
|
<table>
<thead>
<tr>
<th>Failed Tests</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<details>
<summary>❌ Test name</summary>
```diff
... Skipped lines
{
thing: {
+ id: 111,
- id: 222,
prop1: 'aaa',
prop2: 'bbb'
},
prop3: 'ccc',
prop4: 'ddd',
...
{
+ id: 333,
- id: 555,
}
],
prop5: 'eee',
prop6: 'fff',
prop7: [
```
</details>
</td>
</tr>
</tbody>
</table>
It's a bit clumsy, because of the HTML table, but seems to render okay on GitHub. Can you see any drawbacks?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the code that formats assertion failures and the generated GitHub test summary, then compare its output with the proposed diff-markdown example. The work is done when long assertion failures render with GitHub diff syntax highlighting without changing the existing layout; the payload names no specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100