1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-02-04 13:37:56 +01:00

feat: Add listTestCaseTime flag to print test times next to test names

- Add a new listTestCaseTime flag, that optionally prints test times
next to test names. This flag defaults to false, for backward
compatibility.
- Update get-report.ts to use this flag when generating a report.
- Update existing tests to set ReportOptions listTestCaseTime: true to
verify above feature.
- Update README with documentation about this new flag.

Note this feature was needed for individual test times under pytest,
since the xml is generated with all tests under one test suite.

https://github.com/dorny/test-reporter/issues/260
This commit is contained in:
Rick Shanor 2026-01-06 07:39:38 -08:00
parent a810f9bf83
commit fb2dd2ba55
5 changed files with 31 additions and 7 deletions

View file

@ -11,9 +11,9 @@
### ❌ <a id="user-content-r0s0" href="#user-content-r0s0">__tests__\main.test.js</a>
```
Test 1
✅ Passing test
✅ Passing test (1ms)
Test 1 Test 1.1
❌ Failing test
❌ Failing test (2ms)
Error: expect(received).toBeTruthy()
❌ Exception in target unit
Error: Some error
@ -23,7 +23,7 @@ Test 2
```
### ❌ <a id="user-content-r0s1" href="#user-content-r0s1">__tests__\second.test.js</a>
```
❌ Timeout test
❌ Timeout test (4ms)
: Timeout - Async callback was not invoked within the 1 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 1 ms timeout specified by jest.setTimeout.Error:
⚪ Skipped test
```