tolkira 0.1.1 → 0.2.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.
- package/DESIGN.md +12 -7
- package/GLOSSARY.md +15 -0
- package/README.md +30 -16
- package/dist/cli.js +531 -92
- package/dist/cli.js.map +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +472 -88
- package/dist/index.js.map +3 -3
- package/dist/input/junit.d.ts +3 -1
- package/dist/input/load.d.ts +11 -0
- package/dist/render/escape.d.ts +1 -1
- package/dist/render/html.d.ts +1 -0
- package/dist/report/model.d.ts +4 -1
- package/dist/summary.d.ts +1 -0
- package/docs/COMPATIBILITY.md +14 -4
- package/package.json +2 -1
package/dist/input/junit.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Envelope } from '@cucumber/messages';
|
|
2
2
|
export declare function looksLikeJUnit(content: string): boolean;
|
|
3
|
-
export declare function parseJUnitXml(content: string, source: string
|
|
3
|
+
export declare function parseJUnitXml(content: string, source: string, options?: {
|
|
4
|
+
idPrefix?: string;
|
|
5
|
+
}): Promise<Envelope[]>;
|
package/dist/input/load.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import type { Envelope } from '@cucumber/messages';
|
|
2
|
+
export interface LoadedInput {
|
|
3
|
+
file: string;
|
|
4
|
+
envelopes: Envelope[];
|
|
5
|
+
}
|
|
6
|
+
export declare function loadInputs(inputs: string | string[]): Promise<LoadedInput[]>;
|
|
2
7
|
export declare function loadEnvelopes(inputs: string | string[]): Promise<Envelope[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Maps a feature URI to its input file name, but only when the URI belongs to
|
|
10
|
+
* exactly one file. Shared or missing provenance is omitted so the report can
|
|
11
|
+
* render a flat list instead of an invented group.
|
|
12
|
+
*/
|
|
13
|
+
export declare function provenanceFor(groups: LoadedInput[]): Map<string, string>;
|
package/dist/render/escape.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function escapeHtml(value:
|
|
1
|
+
export declare function escapeHtml(value: unknown): string;
|
package/dist/render/html.d.ts
CHANGED
package/dist/report/model.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export interface ReportFeature {
|
|
|
48
48
|
durationMs: number;
|
|
49
49
|
scenarios: ReportScenario[];
|
|
50
50
|
attachments: number;
|
|
51
|
+
sourceFile?: string;
|
|
51
52
|
}
|
|
52
53
|
export interface ReportCounts {
|
|
53
54
|
features: number;
|
|
@@ -78,4 +79,6 @@ export interface ReportModel {
|
|
|
78
79
|
scenarios: ReportScenario[];
|
|
79
80
|
runAttachments: ReportAttachment[];
|
|
80
81
|
}
|
|
81
|
-
|
|
82
|
+
/** Raw Cucumber ordinal; the report comparator forces passed last. */
|
|
83
|
+
export declare function statusSeverity(status: ReportStatus): number;
|
|
84
|
+
export declare function buildReportModel(envelopes: Envelope[], provenance?: Map<string, string>): ReportModel;
|
package/dist/summary.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export interface ReportSummary {
|
|
|
44
44
|
};
|
|
45
45
|
scenarios: SummaryScenario[];
|
|
46
46
|
}
|
|
47
|
+
export declare function displayUri(uri: string): string;
|
|
47
48
|
/**
|
|
48
49
|
* Builds a stable, renderer-independent summary from Cucumber Messages.
|
|
49
50
|
* This is the machine-readable contract for agents and CI tools.
|
package/docs/COMPATIBILITY.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
**Status: experimental.** The compatibility subpath accepts the legacy options
|
|
4
4
|
object and renders with Tolkira. It is a migration aid, not a promise of visual
|
|
5
|
-
parity.
|
|
5
|
+
parity. The shim is ESM-only and asynchronous: use Node 22 or later,
|
|
6
|
+
`import { generate }` and `await generate(...)` before reading the report.
|
|
6
7
|
|
|
7
8
|
## Before and after
|
|
8
9
|
|
|
@@ -32,8 +33,8 @@ await generate({
|
|
|
32
33
|
});
|
|
33
34
|
```
|
|
34
35
|
|
|
35
|
-
Only the import changes
|
|
36
|
-
maps to Tolkira. The callback form still works:
|
|
36
|
+
Only the import changes, plus `await` and Node 22 or later. `theme` is ignored
|
|
37
|
+
with a warning; everything else maps to Tolkira. The callback form still works:
|
|
37
38
|
|
|
38
39
|
```js
|
|
39
40
|
generate(options, (error) => {
|
|
@@ -66,7 +67,7 @@ generation fails with a usage error.
|
|
|
66
67
|
not cloned. The report keeps Tolkira's simple shell and Details view.
|
|
67
68
|
- **External screenshots.** `storeScreenshots`, `screenshotsDirectory` and
|
|
68
69
|
`noInlineScreenshots` are ignored because Tolkira always inlines attachments.
|
|
69
|
-
Very large runs can hit the 10 MB size warning; split assets are a
|
|
70
|
+
Very large runs can hit the 10 MB size warning; split assets are a later item.
|
|
70
71
|
- **The old rendered HTML.** The shim consumes the input JSON and options, not
|
|
71
72
|
the generated HTML. If you only have the old HTML, export the JSON again.
|
|
72
73
|
- **The `output + '.json'` side effect.** Tolkira does not write a merged JSON
|
|
@@ -74,6 +75,15 @@ generation fails with a usage error.
|
|
|
74
75
|
- **Custom CSS/JS, i18n, email reports, CDN mode and browser launch.** These
|
|
75
76
|
conflict with the single-file, no-network baseline or are out of scope.
|
|
76
77
|
|
|
78
|
+
## Seed-Test
|
|
79
|
+
|
|
80
|
+
Seed-Test 2.0's dev/AI integration branch is ESM. Use
|
|
81
|
+
`import { generate } from 'tolkira/compat/cucumber-html-reporter'` and await
|
|
82
|
+
the call before reading the HTML. Seed-Test 1.x is CommonJS and needs an ESM
|
|
83
|
+
wrapper or an upgrade; the shim does not provide a CommonJS entry point.
|
|
84
|
+
Seed-Test's group mode also expects a sidecar at `output + '.json'`; Tolkira
|
|
85
|
+
does not write that file.
|
|
86
|
+
|
|
77
87
|
## Limits
|
|
78
88
|
|
|
79
89
|
- The shim accepts legacy Cucumber JSON. It does not turn Messages into legacy
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tolkira",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "The interpreter for your test results. Self-contained HTML reports for Cucumber JSON, Messages, and beyond.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"test": "npm run styles && vitest run",
|
|
63
63
|
"test:e2e": "playwright test",
|
|
64
64
|
"styles": "node scripts/build-styles.mjs",
|
|
65
|
+
"prestress": "npm run build",
|
|
65
66
|
"stress": "node scripts/stress.mjs",
|
|
66
67
|
"check": "npm run styles && npm run typecheck && npm run lint && npm run test && npm run build",
|
|
67
68
|
"prepublishOnly": "npm run check"
|