@wp-tester/results 0.0.5 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/diff-utils.d.ts +27 -0
  2. package/dist/diff-utils.d.ts.map +1 -0
  3. package/dist/diff-utils.js +116 -0
  4. package/dist/diff-utils.js.map +1 -0
  5. package/dist/diff-utils.spec.d.ts +5 -0
  6. package/dist/diff-utils.spec.d.ts.map +1 -0
  7. package/dist/diff-utils.spec.js +85 -0
  8. package/dist/diff-utils.spec.js.map +1 -0
  9. package/dist/index.d.ts +7 -3
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +4 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/merge.d.ts.map +1 -1
  14. package/dist/merge.js +21 -2
  15. package/dist/merge.js.map +1 -1
  16. package/dist/merge.spec.js +230 -0
  17. package/dist/merge.spec.js.map +1 -1
  18. package/dist/phpunit-streaming-reporter.d.ts +19 -0
  19. package/dist/phpunit-streaming-reporter.d.ts.map +1 -0
  20. package/dist/phpunit-streaming-reporter.js +26 -0
  21. package/dist/phpunit-streaming-reporter.js.map +1 -0
  22. package/dist/spinner.d.ts +20 -0
  23. package/dist/spinner.d.ts.map +1 -0
  24. package/dist/spinner.js +36 -0
  25. package/dist/spinner.js.map +1 -0
  26. package/dist/streaming.d.ts +36 -0
  27. package/dist/streaming.d.ts.map +1 -1
  28. package/dist/streaming.js +250 -56
  29. package/dist/streaming.js.map +1 -1
  30. package/dist/streaming.spec.js +115 -2
  31. package/dist/streaming.spec.js.map +1 -1
  32. package/dist/summary.d.ts +12 -1
  33. package/dist/summary.d.ts.map +1 -1
  34. package/dist/summary.js +40 -6
  35. package/dist/summary.js.map +1 -1
  36. package/dist/teamcity-parser.d.ts.map +1 -1
  37. package/dist/teamcity-parser.js +19 -1
  38. package/dist/teamcity-parser.js.map +1 -1
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/dist/vitest-streaming-reporter.d.ts +3 -3
  41. package/dist/vitest-streaming-reporter.d.ts.map +1 -1
  42. package/dist/vitest-streaming-reporter.js +63 -4
  43. package/dist/vitest-streaming-reporter.js.map +1 -1
  44. package/dist/vitest-streaming.d.ts +19 -0
  45. package/dist/vitest-streaming.d.ts.map +1 -0
  46. package/dist/vitest-streaming.js +28 -0
  47. package/dist/vitest-streaming.js.map +1 -0
  48. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Diff Highlighting Utilities
3
+ *
4
+ * Shared utilities for highlighting character-level differences between strings.
5
+ * Used by both Vitest and PHPUnit streaming reporters.
6
+ */
7
+ /**
8
+ * Apply character-level highlighting to diff lines
9
+ * Converts «text» markers to bold/bright text
10
+ */
11
+ export declare function applyDiffHighlighting(line: string, colorFn: (str: string) => string): string;
12
+ /**
13
+ * Apply diff markers to multiline strings, putting markers on each line
14
+ * This ensures the renderer can process each line independently
15
+ */
16
+ export declare function applyMarkersToMultiline(text: string): string;
17
+ /**
18
+ * Highlight character-level differences between two strings
19
+ * Adds markers for rendering differences in bold/bright
20
+ * Uses « and » markers that will be processed by applyDiffHighlighting
21
+ * Handles multiline strings by ensuring markers don't span newlines
22
+ */
23
+ export declare function highlightStringDiff(expected: string, actual: string): {
24
+ expected: string;
25
+ actual: string;
26
+ };
27
+ //# sourceMappingURL=diff-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-utils.d.ts","sourceRoot":"","sources":["../src/diff-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAwB5F;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM5D;AA0CD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAqC1G"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Diff Highlighting Utilities
3
+ *
4
+ * Shared utilities for highlighting character-level differences between strings.
5
+ * Used by both Vitest and PHPUnit streaming reporters.
6
+ */
7
+ import pc from "picocolors";
8
+ /**
9
+ * Apply character-level highlighting to diff lines
10
+ * Converts «text» markers to bold/bright text
11
+ */
12
+ export function applyDiffHighlighting(line, colorFn) {
13
+ // Find all highlighted sections marked with « and »
14
+ const parts = [];
15
+ let lastIndex = 0;
16
+ const regex = /«([^»]+)»/g;
17
+ let match;
18
+ while ((match = regex.exec(line)) !== null) {
19
+ // Add the text before the highlight (normal color, not dimmed)
20
+ if (match.index > lastIndex) {
21
+ parts.push(colorFn(line.slice(lastIndex, match.index)));
22
+ }
23
+ // Add the highlighted text (bright/bold)
24
+ parts.push(pc.bold(colorFn(match[1])));
25
+ lastIndex = match.index + match[0].length;
26
+ }
27
+ // Add any remaining text after the last highlight
28
+ if (lastIndex < line.length) {
29
+ parts.push(colorFn(line.slice(lastIndex)));
30
+ }
31
+ // If no highlights found, return the line with color applied
32
+ return parts.length > 0 ? parts.join('') : colorFn(line);
33
+ }
34
+ /**
35
+ * Apply diff markers to multiline strings, putting markers on each line
36
+ * This ensures the renderer can process each line independently
37
+ */
38
+ export function applyMarkersToMultiline(text) {
39
+ if (!text)
40
+ return '';
41
+ // Split by newlines, apply markers to each line, then rejoin
42
+ const lines = text.split('\n');
43
+ return lines.map(line => line ? `«${line}»` : '').join('\n');
44
+ }
45
+ /**
46
+ * Ensure markers don't span newlines by splitting and re-wrapping
47
+ * Converts "text«diff\nmore»end" to "text«diff»\n«more»end"
48
+ */
49
+ function ensureMarkersPerLine(text) {
50
+ // Split by markers first to identify highlighted sections
51
+ const parts = [];
52
+ let lastIndex = 0;
53
+ const regex = /«([^»]+)»/g;
54
+ let match;
55
+ while ((match = regex.exec(text)) !== null) {
56
+ // Add text before the marker
57
+ if (match.index > lastIndex) {
58
+ parts.push(text.slice(lastIndex, match.index));
59
+ }
60
+ // Split the highlighted section by newlines and re-wrap each line
61
+ const highlighted = match[1];
62
+ const lines = highlighted.split('\n');
63
+ for (let i = 0; i < lines.length; i++) {
64
+ if (lines[i]) {
65
+ parts.push(`«${lines[i]}»`);
66
+ }
67
+ if (i < lines.length - 1) {
68
+ parts.push('\n');
69
+ }
70
+ }
71
+ lastIndex = match.index + match[0].length;
72
+ }
73
+ // Add any remaining text
74
+ if (lastIndex < text.length) {
75
+ parts.push(text.slice(lastIndex));
76
+ }
77
+ return parts.length > 0 ? parts.join('') : text;
78
+ }
79
+ /**
80
+ * Highlight character-level differences between two strings
81
+ * Adds markers for rendering differences in bold/bright
82
+ * Uses « and » markers that will be processed by applyDiffHighlighting
83
+ * Handles multiline strings by ensuring markers don't span newlines
84
+ */
85
+ export function highlightStringDiff(expected, actual) {
86
+ // Find common prefix
87
+ let prefixEnd = 0;
88
+ const minLen = Math.min(expected.length, actual.length);
89
+ while (prefixEnd < minLen && expected[prefixEnd] === actual[prefixEnd]) {
90
+ prefixEnd++;
91
+ }
92
+ // Find common suffix (starting from the end, but not overlapping with prefix)
93
+ let suffixStart = expected.length;
94
+ let actualSuffixStart = actual.length;
95
+ while (suffixStart > prefixEnd &&
96
+ actualSuffixStart > prefixEnd &&
97
+ expected[suffixStart - 1] === actual[actualSuffixStart - 1]) {
98
+ suffixStart--;
99
+ actualSuffixStart--;
100
+ }
101
+ // Build highlighted strings with markers for the renderer
102
+ const expectedPrefix = expected.slice(0, prefixEnd);
103
+ const expectedDiff = expected.slice(prefixEnd, suffixStart);
104
+ const expectedSuffix = expected.slice(suffixStart);
105
+ const actualPrefix = actual.slice(0, prefixEnd);
106
+ const actualDiff = actual.slice(prefixEnd, actualSuffixStart);
107
+ const actualSuffix = actual.slice(actualSuffixStart);
108
+ const highlightedExpected = expectedPrefix + (expectedDiff ? `«${expectedDiff}»` : '') + expectedSuffix;
109
+ const highlightedActual = actualPrefix + (actualDiff ? `«${actualDiff}»` : '') + actualSuffix;
110
+ // Ensure markers don't span newlines for multiline strings
111
+ return {
112
+ expected: ensureMarkersPerLine(highlightedExpected),
113
+ actual: ensureMarkersPerLine(highlightedActual)
114
+ };
115
+ }
116
+ //# sourceMappingURL=diff-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-utils.js","sourceRoot":"","sources":["../src/diff-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,OAAgC;IAClF,oDAAoD;IACpD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,MAAM,KAAK,GAAG,YAAY,CAAC;IAC3B,IAAI,KAAK,CAAC;IAEV,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC3C,+DAA+D;QAC/D,IAAI,KAAK,CAAC,KAAK,GAAG,SAAS,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC;QACD,yCAAyC;QACzC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,SAAS,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5C,CAAC;IAED,kDAAkD;IAClD,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,OAA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 {"version":3,"file":"diff-utils.spec.d.ts","sourceRoot":"","sources":["../src/diff-utils.spec.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Tests for diff-utils
3
+ */
4
+ import { describe, it, expect } from "vitest";
5
+ import { highlightStringDiff, applyDiffHighlighting } from "./diff-utils.js";
6
+ describe("highlightStringDiff", () => {
7
+ it("should highlight differences in single-line strings", () => {
8
+ const expected = "Hello World";
9
+ const actual = "Hello There";
10
+ const result = highlightStringDiff(expected, actual);
11
+ expect(result.expected).toBe("Hello «World»");
12
+ expect(result.actual).toBe("Hello «There»");
13
+ });
14
+ it("should not add markers when strings are identical", () => {
15
+ const expected = "Hello World";
16
+ const actual = "Hello World";
17
+ const result = highlightStringDiff(expected, actual);
18
+ expect(result.expected).toBe("Hello World");
19
+ expect(result.actual).toBe("Hello World");
20
+ });
21
+ it("should ensure markers don't span newlines in multiline strings", () => {
22
+ const expected = "Hello World\nTest";
23
+ const actual = "Hello World";
24
+ const result = highlightStringDiff(expected, actual);
25
+ // Check that no marker spans a newline
26
+ const hasMarkerSpanningNewline = /«[^»]*\n[^«]*»/.test(result.expected);
27
+ expect(hasMarkerSpanningNewline).toBe(false);
28
+ // Expected should have the diff part highlighted
29
+ // The diff is "\nTest" which gets split at the newline
30
+ // After ensureMarkersPerLine, markers are split: "Hello World\n«Test»"
31
+ // (The newline itself doesn't get wrapped since it becomes an empty line)
32
+ expect(result.expected).toBe("Hello World\n«Test»");
33
+ });
34
+ it("should handle multiline diffs correctly", () => {
35
+ const expected = "'Hello World Test\\n\n\t\ttest'";
36
+ const actual = "'Hello World Test'";
37
+ const result = highlightStringDiff(expected, actual);
38
+ // Verify no markers span newlines
39
+ const expectedHasSpanning = /«[^»]*\n[^«]*»/.test(result.expected);
40
+ const actualHasSpanning = /«[^»]*\n[^«]*»/.test(result.actual);
41
+ expect(expectedHasSpanning).toBe(false);
42
+ expect(actualHasSpanning).toBe(false);
43
+ // The diff is "\\n\n\t\ttest" which should be split at the real newline
44
+ // First line should end with «\\n»
45
+ const lines = result.expected.split('\n');
46
+ expect(lines[0]).toContain("«\\n»");
47
+ });
48
+ });
49
+ describe("applyDiffHighlighting", () => {
50
+ it("should apply bold styling to marked sections", () => {
51
+ const line = "Hello «World»";
52
+ // Mock color function that just returns the text
53
+ const colorFn = (str) => str;
54
+ const result = applyDiffHighlighting(line, colorFn);
55
+ // The result should contain bold markers for "World"
56
+ // pc.bold wraps with ANSI codes when colors are enabled
57
+ // Since we can't control color state in tests, just verify structure
58
+ expect(result).toContain("Hello ");
59
+ expect(result).toContain("World");
60
+ });
61
+ it("should handle multiple markers in a line", () => {
62
+ const line = "«Hello» World «Test»";
63
+ const colorFn = (str) => str;
64
+ const result = applyDiffHighlighting(line, colorFn);
65
+ expect(result).toContain("Hello");
66
+ expect(result).toContain(" World ");
67
+ expect(result).toContain("Test");
68
+ });
69
+ it("should handle lines without markers", () => {
70
+ const line = "Hello World";
71
+ const colorFn = (str) => `[${str}]`;
72
+ const result = applyDiffHighlighting(line, colorFn);
73
+ expect(result).toBe("[Hello World]");
74
+ });
75
+ it("should not match markers that span multiple lines", () => {
76
+ // This shouldn't happen with our ensureMarkersPerLine fix,
77
+ // but test that the regex doesn't match across lines
78
+ const line = "Hello «World";
79
+ const colorFn = (str) => str;
80
+ const result = applyDiffHighlighting(line, colorFn);
81
+ // Should just apply color to the whole line since no complete marker
82
+ expect(result).toBe("Hello «World");
83
+ });
84
+ });
85
+ //# sourceMappingURL=diff-utils.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-utils.spec.js","sourceRoot":"","sources":["../src/diff-utils.spec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,QAAQ,CAAC,qBAAqB,E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,12 +5,16 @@
5
5
  * See https://ctrf.io for more information about the CTRF standard.
6
6
  */
7
7
  import { Report } from "ctrf";
8
- export type { Report, Results, Summary, Test, TestStatus, Tool, } from 'ctrf';
8
+ export type { Report, Results, Summary, Test, TestStatus, Tool, } from "ctrf";
9
9
  export { vitestToCTRF } from './parsers/vitest.js';
10
10
  export { mergeReports } from './merge.js';
11
- export { StreamingReporter, stdoutWriter, createTestFromEvent, type StreamEvent, type TestEvent, type SuiteEvent, type RunEvent, type StreamWriter, type StreamingReporterOptions, } from './streaming.js';
11
+ export { Spinner, SPINNER_FRAMES, type SpinnerOptions, } from './spinner.js';
12
+ export { StreamingReporter, stdoutWriter, createTestFromEvent, type StreamEvent, type TestEvent, type SuiteEvent, type RunEvent, type StreamWriter, type StreamingReporterOptions, type ReporterFilterOptions, } from './streaming.js';
13
+ export { VitestStreamingBase, } from './vitest-streaming.js';
14
+ export { applyDiffHighlighting, highlightStringDiff } from './diff-utils.js';
15
+ export { PHPUnitStreamingReporter, } from './phpunit-streaming-reporter.js';
12
16
  export { VitestStreamingReporter, createVitestStreamingReporter, } from './vitest-streaming-reporter.js';
13
17
  export { TeamCityParser, createTeamCityParserStream, parseTeamCityOutput, } from './teamcity-parser.js';
14
- export { printSummary } from './summary.js';
18
+ export { printSummary, type SummaryOptions } from './summary.js';
15
19
  export declare const EMPTY_REPORT: Report;
16
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,YAAY,EACV,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,EACJ,UAAU,EACV,IAAI,GACL,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OA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AuB,EACvB,6BAA6B,GAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEjE,eAAO,MAAM,YAAY,EAAE,MAmB1B,CAAC"}
package/dist/index.js CHANGED
@@ -6,7 +6,11 @@
6
6
  */
7
7
  export { vitestToCTRF } from './parsers/vitest.js';
8
8
  export { mergeReports } from './merge.js';
9
+ export { Spinner, SPINNER_FRAMES, } from './spinner.js';
9
10
  export { StreamingReporter, stdoutWriter, createTestFromEvent, } from './streaming.js';
11
+ export { VitestStreamingBase, } from './vitest-streaming.js';
12
+ export { applyDiffHighlighting, highlightStringDiff } from './diff-utils.js';
13
+ export { PHPUnitStreamingReporter, } from './phpunit-streaming-reporter.js';
10
14
  export { VitestStreamingReporter, createVitestStreamingReporter, } from './vitest-streaming-reporter.js';
11
15
  export { TeamCityParser, createTeamCityParserStream, parseTeamCityOutput, } from './teamcity-parser.js';
12
16
  export { printSummary } from './summary.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,GAOpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAW;IACl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,EAAE,CAAC;YACV,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE;YACjB,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;YAChB,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,CAAC;SACT;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,uBAAuB;SAC9B;QACD,KAAK,EAAE,EAAE;KACV;IACD,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,OAAO;CACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../src/merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAyDtD"}
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../src/merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CA6EtD"}
package/dist/merge.js CHANGED
@@ -7,7 +7,13 @@ export function mergeReports(reports) {
7
7
  const original = reports[0];
8
8
  return {
9
9
  results: {
10
- summary: { ...original.results.summary },
10
+ summary: {
11
+ ...original.results.summary,
12
+ // Preserve extra field including warnings
13
+ ...(original.results.summary.extra && {
14
+ extra: { ...original.results.summary.extra },
15
+ }),
16
+ },
11
17
  tool: { ...original.results.tool },
12
18
  tests: [...original.results.tests],
13
19
  },
@@ -27,6 +33,7 @@ export function mergeReports(reports) {
27
33
  stop: -Infinity,
28
34
  };
29
35
  const allTests = [];
36
+ const allWarnings = [];
30
37
  for (const report of reports) {
31
38
  // Sum counts
32
39
  summary.tests += report.results.summary.tests;
@@ -38,13 +45,25 @@ export function mergeReports(reports) {
38
45
  // Calculate time span
39
46
  summary.start = Math.min(summary.start, report.results.summary.start);
40
47
  summary.stop = Math.max(summary.stop, report.results.summary.stop);
48
+ // Collect warnings from extra field
49
+ const warnings = report.results.summary.extra?.warnings;
50
+ if (Array.isArray(warnings)) {
51
+ allWarnings.push(...warnings);
52
+ }
41
53
  // Concatenate tests
42
54
  allTests.push(...report.results.tests);
43
55
  }
44
56
  return {
45
57
  ...EMPTY_REPORT,
46
58
  results: {
47
- summary,
59
+ summary: {
60
+ ...summary,
61
+ ...(allWarnings.length > 0 && {
62
+ extra: {
63
+ warnings: allWarnings,
64
+ },
65
+ }),
66
+ },
48
67
  tool: { name: 'wp-tester' },
49
68
  tests: allTests,
50
69
  },
package/dist/merge.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"merge.js","sourceRoot":"","sources":["../src/merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEjC,MAAM,UAAU,YAAY,CAAC,OAAiB;IAC5C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B,OAAO;YACL,OAAO,EAAE;gBACP,OAAO,EAAE,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE;gBACxC,IAAI,EAAE,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;gBAClC,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;aACnC;YACD,YAAY,EAAE,QAAQ,CAAC,YAAY;YACnC,WAAW,EAAE,QAAQ,CAAC,WAAW;SAClC,CAAC;IACJ,CAAC;IAED,yBAAyB;IACzB,MAAM,OAAO,GAAG;QACd,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;QACT,OAAO,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C,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI;oBAC5B,KAAK,EAAE;wBACL,QAAQ,EAAE,WAAW;qBACtB;iBACF,CAAC;aACH;YACD,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;YAC3B,KAAK,EAAE,QAAQ;SAChB;KACF,CAAC;AACJ,CAAC"}
@@ -159,5 +159,235 @@ describe('mergeReports', () => {
159
159
  expect(report1).toEqual(originalReport1);
160
160
  expect(report2).toEqual(originalReport2);
161
161
  });
162
+ describe('warnings support', () => {
163
+ it('should preserve warnings from single report', () => {
164
+ const report = {
165
+ results: {
166
+ summary: {
167
+ tests: 2,
168
+ passed: 2,
169
+ failed: 0,
170
+ skipped: 0,
171
+ pending: 0,
172
+ other: 0,
173
+ start: 1000,
174
+ stop: 1500,
175
+ extra: {
176
+ warnings: ['Warning 1', 'Warning 2'],
177
+ },
178
+ },
179
+ tool: { name: 'tool1' },
180
+ tests: [{ name: 'test1', status: 'passed', duration: 100 }],
181
+ },
182
+ reportFormat: 'CTRF',
183
+ specVersion: '0.0.4',
184
+ };
185
+ const result = mergeReports([report]);
186
+ expect(result.results.summary.extra?.warnings).toEqual(['Warning 1', 'Warning 2']);
187
+ });
188
+ it('should merge warnings from multiple reports', () => {
189
+ const report1 = {
190
+ results: {
191
+ summary: {
192
+ tests: 2,
193
+ passed: 2,
194
+ failed: 0,
195
+ skipped: 0,
196
+ pending: 0,
197
+ other: 0,
198
+ start: 1000,
199
+ stop: 1500,
200
+ extra: {
201
+ warnings: ['Warning from report 1'],
202
+ },
203
+ },
204
+ tool: { name: 'tool1' },
205
+ tests: [{ name: 'test1', status: 'passed', duration: 100 }],
206
+ },
207
+ reportFormat: 'CTRF',
208
+ specVersion: '0.0.4',
209
+ };
210
+ const report2 = {
211
+ results: {
212
+ summary: {
213
+ tests: 3,
214
+ passed: 3,
215
+ failed: 0,
216
+ skipped: 0,
217
+ pending: 0,
218
+ other: 0,
219
+ start: 1200,
220
+ stop: 1800,
221
+ extra: {
222
+ warnings: ['Warning from report 2', 'Another warning'],
223
+ },
224
+ },
225
+ tool: { name: 'tool2' },
226
+ tests: [{ name: 'test2', status: 'passed', duration: 200 }],
227
+ },
228
+ reportFormat: 'CTRF',
229
+ specVersion: '0.0.4',
230
+ };
231
+ const result = mergeReports([report1, report2]);
232
+ expect(result.results.summary.extra?.warnings).toEqual([
233
+ 'Warning from report 1',
234
+ 'Warning from report 2',
235
+ 'Another warning',
236
+ ]);
237
+ });
238
+ it('should handle reports with no warnings', () => {
239
+ const report1 = {
240
+ results: {
241
+ summary: {
242
+ tests: 2,
243
+ passed: 2,
244
+ failed: 0,
245
+ skipped: 0,
246
+ pending: 0,
247
+ other: 0,
248
+ start: 1000,
249
+ stop: 1500,
250
+ },
251
+ tool: { name: 'tool1' },
252
+ tests: [{ name: 'test1', status: 'passed', duration: 100 }],
253
+ },
254
+ reportFormat: 'CTRF',
255
+ specVersion: '0.0.4',
256
+ };
257
+ const report2 = {
258
+ results: {
259
+ summary: {
260
+ tests: 3,
261
+ passed: 3,
262
+ failed: 0,
263
+ skipped: 0,
264
+ pending: 0,
265
+ other: 0,
266
+ start: 1200,
267
+ stop: 1800,
268
+ },
269
+ tool: { name: 'tool2' },
270
+ tests: [{ name: 'test2', status: 'passed', duration: 200 }],
271
+ },
272
+ reportFormat: 'CTRF',
273
+ specVersion: '0.0.4',
274
+ };
275
+ const result = mergeReports([report1, report2]);
276
+ expect(result.results.summary.extra).toBeUndefined();
277
+ });
278
+ it('should handle mix of reports with and without warnings', () => {
279
+ const report1 = {
280
+ results: {
281
+ summary: {
282
+ tests: 2,
283
+ passed: 2,
284
+ failed: 0,
285
+ skipped: 0,
286
+ pending: 0,
287
+ other: 0,
288
+ start: 1000,
289
+ stop: 1500,
290
+ extra: {
291
+ warnings: ['Warning from report 1'],
292
+ },
293
+ },
294
+ tool: { name: 'tool1' },
295
+ tests: [{ name: 'test1', status: 'passed', duration: 100 }],
296
+ },
297
+ reportFormat: 'CTRF',
298
+ specVersion: '0.0.4',
299
+ };
300
+ const report2 = {
301
+ results: {
302
+ summary: {
303
+ tests: 3,
304
+ passed: 3,
305
+ failed: 0,
306
+ skipped: 0,
307
+ pending: 0,
308
+ other: 0,
309
+ start: 1200,
310
+ stop: 1800,
311
+ },
312
+ tool: { name: 'tool2' },
313
+ tests: [{ name: 'test2', status: 'passed', duration: 200 }],
314
+ },
315
+ reportFormat: 'CTRF',
316
+ specVersion: '0.0.4',
317
+ };
318
+ const report3 = {
319
+ results: {
320
+ summary: {
321
+ tests: 1,
322
+ passed: 1,
323
+ failed: 0,
324
+ skipped: 0,
325
+ pending: 0,
326
+ other: 0,
327
+ start: 1100,
328
+ stop: 2000,
329
+ extra: {
330
+ warnings: ['Warning from report 3'],
331
+ },
332
+ },
333
+ tool: { name: 'tool3' },
334
+ tests: [{ name: 'test3', status: 'passed', duration: 50 }],
335
+ },
336
+ reportFormat: 'CTRF',
337
+ specVersion: '0.0.4',
338
+ };
339
+ const result = mergeReports([report1, report2, report3]);
340
+ expect(result.results.summary.extra?.warnings).toEqual([
341
+ 'Warning from report 1',
342
+ 'Warning from report 3',
343
+ ]);
344
+ });
345
+ it('should ignore invalid warnings that are not arrays', () => {
346
+ const report1 = {
347
+ results: {
348
+ summary: {
349
+ tests: 2,
350
+ passed: 2,
351
+ failed: 0,
352
+ skipped: 0,
353
+ pending: 0,
354
+ other: 0,
355
+ start: 1000,
356
+ stop: 1500,
357
+ extra: {
358
+ warnings: 'not an array',
359
+ },
360
+ },
361
+ tool: { name: 'tool1' },
362
+ tests: [{ name: 'test1', status: 'passed', duration: 100 }],
363
+ },
364
+ reportFormat: 'CTRF',
365
+ specVersion: '0.0.4',
366
+ };
367
+ const report2 = {
368
+ results: {
369
+ summary: {
370
+ tests: 3,
371
+ passed: 3,
372
+ failed: 0,
373
+ skipped: 0,
374
+ pending: 0,
375
+ other: 0,
376
+ start: 1200,
377
+ stop: 1800,
378
+ extra: {
379
+ warnings: ['Valid warning'],
380
+ },
381
+ },
382
+ tool: { name: 'tool2' },
383
+ tests: [{ name: 'test2', status: 'passed', duration: 200 }],
384
+ },
385
+ reportFormat: 'CTRF',
386
+ specVersion: '0.0.4',
387
+ };
388
+ const result = mergeReports([report1, report2]);
389
+ expect(result.results.summary.extra?.warnings).toEqual(['Valid warning']);
390
+ });
391
+ });
162
392
  });
163
393
  //# sourceMappingURL=merge.spec.js.map