Skip to content

Commit 9a9323e

Browse files
committed
chore: remove non-schema properties from insights
1 parent a11ad86 commit 9a9323e

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Explore more <a href="https://www.ctrf.io/integrations">integrations</a>
2727
## Installation
2828

2929
```sh
30-
npm install ctrf@0.0.13-next.5
30+
npm install ctrf
3131
```
3232

3333
## API reference

src/methods/run-insights.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ describe('enrichReportWithInsights - Main API', () => {
322322
})
323323

324324
describe('added/removed tests tracking', () => {
325-
it('should track tests added since baseline', () => {
325+
it.skip('should track tests added since baseline', () => {
326326
const currentTests = [
327327
createMockTest({ name: 'test1', status: 'passed' }),
328328
createMockTest({ name: 'test2', status: 'passed' }),
@@ -350,7 +350,7 @@ describe('enrichReportWithInsights - Main API', () => {
350350
)
351351
})
352352

353-
it('should track tests removed since baseline', () => {
353+
it.skip('should track tests removed since baseline', () => {
354354
const currentTests = [createMockTest({ name: 'test1', status: 'passed' })]
355355
const previousTests = [
356356
createMockTest({ name: 'test1', status: 'passed' }),
@@ -376,7 +376,7 @@ describe('enrichReportWithInsights - Main API', () => {
376376
)
377377
})
378378

379-
it('should handle single report no added/removed tests', () => {
379+
it.skip('should handle single report no added/removed tests', () => {
380380
const currentTests = [createMockTest({ name: 'test1', status: 'passed' })]
381381

382382
const currentReport = createMockReport(currentTests)

src/methods/run-insights.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,14 @@ export function enrichReportWithInsights(
859859
baseline
860860
)
861861

862+
// Remove testsAdded and testsRemoved as they're not part of the official schema yet
863+
if (baselineInsights.extra?.testsAdded) {
864+
delete baselineInsights.extra.testsAdded
865+
}
866+
if (baselineInsights.extra?.testsRemoved) {
867+
delete baselineInsights.extra.testsRemoved
868+
}
869+
862870
return {
863871
...currentReportWithTestInsights,
864872
insights: baselineInsights,

src/test-utils/report-enrichment-helper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export class ReportEnrichmentTestHelper {
5454
other: tests.filter(
5555
t => !['passed', 'failed', 'skipped', 'pending'].includes(t.status)
5656
).length,
57+
flaky: tests.filter(t => t.flaky === true).length,
58+
duration: tests.reduce((sum, t) => sum + t.duration, 0),
5759
start: startTime,
5860
stop: startTime + 5000,
5961
},

0 commit comments

Comments
 (0)