executable-stories-formatters 1.9.0 → 1.9.2
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/dist/adapters.d.cts +183 -1
- package/dist/adapters.d.ts +183 -1
- package/dist/cli.js +348 -1739
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +243 -1721
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -866
- package/dist/index.d.ts +43 -866
- package/dist/index.js +210 -1675
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/index-CmEmALo3.d.cts +0 -634
- package/dist/index-CmEmALo3.d.ts +0 -634
package/dist/adapters.d.cts
CHANGED
|
@@ -1 +1,183 @@
|
|
|
1
|
-
|
|
1
|
+
import { StoryMeta } from 'executable-stories-core/types/story';
|
|
2
|
+
import { RawRun, RawStatus } from 'executable-stories-core/types/raw';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Jest Adapter - Layer 1.
|
|
6
|
+
*
|
|
7
|
+
* Transforms Jest test results and story reports into RawRun.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Jest test result shape (subset of what Jest provides) */
|
|
11
|
+
interface JestTestResult {
|
|
12
|
+
fullName: string;
|
|
13
|
+
status: "passed" | "failed" | "pending" | "todo";
|
|
14
|
+
duration?: number;
|
|
15
|
+
failureMessages?: string[];
|
|
16
|
+
}
|
|
17
|
+
/** Jest file result shape */
|
|
18
|
+
interface JestFileResult {
|
|
19
|
+
testFilePath: string;
|
|
20
|
+
testResults: JestTestResult[];
|
|
21
|
+
}
|
|
22
|
+
/** Jest aggregated result shape */
|
|
23
|
+
interface JestAggregatedResult {
|
|
24
|
+
testResults: JestFileResult[];
|
|
25
|
+
startTime?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Story file report written by story.init() */
|
|
28
|
+
interface StoryFileReport {
|
|
29
|
+
testFilePath: string;
|
|
30
|
+
scenarios: StoryMeta[];
|
|
31
|
+
}
|
|
32
|
+
/** Options for Jest adapter */
|
|
33
|
+
interface JestAdapterOptions {
|
|
34
|
+
/** Project root directory */
|
|
35
|
+
projectRoot?: string;
|
|
36
|
+
/** Package version */
|
|
37
|
+
packageVersion?: string;
|
|
38
|
+
/** Git SHA */
|
|
39
|
+
gitSha?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Adapt Jest results and story reports to RawRun.
|
|
43
|
+
*
|
|
44
|
+
* @param jestResults - Jest aggregated results
|
|
45
|
+
* @param storyReports - Story reports from story.init()
|
|
46
|
+
* @param options - Adapter options
|
|
47
|
+
* @returns RawRun for ACL processing
|
|
48
|
+
*/
|
|
49
|
+
declare function adaptJestRun(jestResults: JestAggregatedResult, storyReports: StoryFileReport[], options?: JestAdapterOptions): RawRun;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Vitest Adapter - Layer 1.
|
|
53
|
+
*
|
|
54
|
+
* Transforms Vitest test results into RawRun.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/** Vitest test state */
|
|
58
|
+
type VitestState = "passed" | "failed" | "skipped" | "pending";
|
|
59
|
+
/** Vitest serialized error */
|
|
60
|
+
interface VitestSerializedError {
|
|
61
|
+
message?: string;
|
|
62
|
+
stack?: string;
|
|
63
|
+
diff?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Vitest test result shape */
|
|
66
|
+
interface VitestTestResult {
|
|
67
|
+
state?: VitestState;
|
|
68
|
+
duration?: number;
|
|
69
|
+
errors?: VitestSerializedError[];
|
|
70
|
+
}
|
|
71
|
+
/** Vitest test case shape (minimal) */
|
|
72
|
+
interface VitestTestCase {
|
|
73
|
+
name: string;
|
|
74
|
+
meta: () => Record<string, unknown>;
|
|
75
|
+
result: () => VitestTestResult | undefined;
|
|
76
|
+
}
|
|
77
|
+
/** Vitest test module shape (minimal) */
|
|
78
|
+
interface VitestTestModule {
|
|
79
|
+
moduleId?: string;
|
|
80
|
+
relativeModuleId?: string;
|
|
81
|
+
children?: {
|
|
82
|
+
allTests: () => Iterable<VitestTestCase>;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Options for Vitest adapter */
|
|
86
|
+
interface VitestAdapterOptions {
|
|
87
|
+
/** Project root directory */
|
|
88
|
+
projectRoot?: string;
|
|
89
|
+
/** Package version */
|
|
90
|
+
packageVersion?: string;
|
|
91
|
+
/** Git SHA */
|
|
92
|
+
gitSha?: string;
|
|
93
|
+
/** Start time (epoch ms) */
|
|
94
|
+
startedAtMs?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Adapt Vitest test modules to RawRun.
|
|
98
|
+
*
|
|
99
|
+
* @param testModules - Vitest test modules
|
|
100
|
+
* @param options - Adapter options
|
|
101
|
+
* @returns RawRun for ACL processing
|
|
102
|
+
*/
|
|
103
|
+
declare function adaptVitestRun(testModules: ReadonlyArray<VitestTestModule>, options?: VitestAdapterOptions): RawRun;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Playwright Adapter - Layer 1.
|
|
107
|
+
*
|
|
108
|
+
* Transforms Playwright test results into RawRun.
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
/** Playwright test status */
|
|
112
|
+
type PlaywrightStatus = "passed" | "failed" | "skipped" | "timedOut" | "interrupted";
|
|
113
|
+
/** Playwright test error */
|
|
114
|
+
interface PlaywrightError {
|
|
115
|
+
message?: string;
|
|
116
|
+
stack?: string;
|
|
117
|
+
}
|
|
118
|
+
/** Playwright attachment */
|
|
119
|
+
interface PlaywrightAttachment {
|
|
120
|
+
name: string;
|
|
121
|
+
contentType: string;
|
|
122
|
+
path?: string;
|
|
123
|
+
body?: Buffer;
|
|
124
|
+
}
|
|
125
|
+
/** Playwright test result */
|
|
126
|
+
interface PlaywrightTestResult {
|
|
127
|
+
status: PlaywrightStatus;
|
|
128
|
+
duration: number;
|
|
129
|
+
errors: PlaywrightError[];
|
|
130
|
+
attachments: PlaywrightAttachment[];
|
|
131
|
+
retry: number;
|
|
132
|
+
/** Optional step events if caller captures Playwright step timing. */
|
|
133
|
+
stepEvents?: Array<{
|
|
134
|
+
index?: number;
|
|
135
|
+
stepId?: string;
|
|
136
|
+
title?: string;
|
|
137
|
+
status?: RawStatus;
|
|
138
|
+
durationMs?: number;
|
|
139
|
+
errorMessage?: string;
|
|
140
|
+
}>;
|
|
141
|
+
}
|
|
142
|
+
/** Playwright test case annotation */
|
|
143
|
+
interface PlaywrightAnnotation {
|
|
144
|
+
type: string;
|
|
145
|
+
description?: string;
|
|
146
|
+
}
|
|
147
|
+
/** Playwright test location */
|
|
148
|
+
interface PlaywrightLocation {
|
|
149
|
+
file: string;
|
|
150
|
+
line: number;
|
|
151
|
+
column: number;
|
|
152
|
+
}
|
|
153
|
+
/** Playwright test case shape (minimal) */
|
|
154
|
+
interface PlaywrightTestCase {
|
|
155
|
+
title: string;
|
|
156
|
+
titlePath: () => string[];
|
|
157
|
+
annotations: PlaywrightAnnotation[];
|
|
158
|
+
location: PlaywrightLocation;
|
|
159
|
+
retries: number;
|
|
160
|
+
}
|
|
161
|
+
/** Options for Playwright adapter */
|
|
162
|
+
interface PlaywrightAdapterOptions {
|
|
163
|
+
/** Project root directory */
|
|
164
|
+
projectRoot?: string;
|
|
165
|
+
/** Package version */
|
|
166
|
+
packageVersion?: string;
|
|
167
|
+
/** Git SHA */
|
|
168
|
+
gitSha?: string;
|
|
169
|
+
/** Start time (epoch ms) */
|
|
170
|
+
startedAtMs?: number;
|
|
171
|
+
/** Playwright project name */
|
|
172
|
+
projectName?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Adapt Playwright test results to RawRun.
|
|
176
|
+
*
|
|
177
|
+
* @param testResults - Array of [testCase, result] tuples
|
|
178
|
+
* @param options - Adapter options
|
|
179
|
+
* @returns RawRun for ACL processing
|
|
180
|
+
*/
|
|
181
|
+
declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun;
|
|
182
|
+
|
|
183
|
+
export { type JestAdapterOptions, type JestAggregatedResult, type JestFileResult, type JestTestResult, type PlaywrightAdapterOptions, type PlaywrightAnnotation, type PlaywrightAttachment, type PlaywrightError, type PlaywrightLocation, type PlaywrightStatus, type PlaywrightTestCase, type PlaywrightTestResult, type StoryFileReport, type VitestAdapterOptions, type VitestSerializedError, type VitestState, type VitestTestCase, type VitestTestModule, type VitestTestResult, adaptJestRun, adaptPlaywrightRun, adaptVitestRun };
|
package/dist/adapters.d.ts
CHANGED
|
@@ -1 +1,183 @@
|
|
|
1
|
-
|
|
1
|
+
import { StoryMeta } from 'executable-stories-core/types/story';
|
|
2
|
+
import { RawRun, RawStatus } from 'executable-stories-core/types/raw';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Jest Adapter - Layer 1.
|
|
6
|
+
*
|
|
7
|
+
* Transforms Jest test results and story reports into RawRun.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Jest test result shape (subset of what Jest provides) */
|
|
11
|
+
interface JestTestResult {
|
|
12
|
+
fullName: string;
|
|
13
|
+
status: "passed" | "failed" | "pending" | "todo";
|
|
14
|
+
duration?: number;
|
|
15
|
+
failureMessages?: string[];
|
|
16
|
+
}
|
|
17
|
+
/** Jest file result shape */
|
|
18
|
+
interface JestFileResult {
|
|
19
|
+
testFilePath: string;
|
|
20
|
+
testResults: JestTestResult[];
|
|
21
|
+
}
|
|
22
|
+
/** Jest aggregated result shape */
|
|
23
|
+
interface JestAggregatedResult {
|
|
24
|
+
testResults: JestFileResult[];
|
|
25
|
+
startTime?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Story file report written by story.init() */
|
|
28
|
+
interface StoryFileReport {
|
|
29
|
+
testFilePath: string;
|
|
30
|
+
scenarios: StoryMeta[];
|
|
31
|
+
}
|
|
32
|
+
/** Options for Jest adapter */
|
|
33
|
+
interface JestAdapterOptions {
|
|
34
|
+
/** Project root directory */
|
|
35
|
+
projectRoot?: string;
|
|
36
|
+
/** Package version */
|
|
37
|
+
packageVersion?: string;
|
|
38
|
+
/** Git SHA */
|
|
39
|
+
gitSha?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Adapt Jest results and story reports to RawRun.
|
|
43
|
+
*
|
|
44
|
+
* @param jestResults - Jest aggregated results
|
|
45
|
+
* @param storyReports - Story reports from story.init()
|
|
46
|
+
* @param options - Adapter options
|
|
47
|
+
* @returns RawRun for ACL processing
|
|
48
|
+
*/
|
|
49
|
+
declare function adaptJestRun(jestResults: JestAggregatedResult, storyReports: StoryFileReport[], options?: JestAdapterOptions): RawRun;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Vitest Adapter - Layer 1.
|
|
53
|
+
*
|
|
54
|
+
* Transforms Vitest test results into RawRun.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/** Vitest test state */
|
|
58
|
+
type VitestState = "passed" | "failed" | "skipped" | "pending";
|
|
59
|
+
/** Vitest serialized error */
|
|
60
|
+
interface VitestSerializedError {
|
|
61
|
+
message?: string;
|
|
62
|
+
stack?: string;
|
|
63
|
+
diff?: string;
|
|
64
|
+
}
|
|
65
|
+
/** Vitest test result shape */
|
|
66
|
+
interface VitestTestResult {
|
|
67
|
+
state?: VitestState;
|
|
68
|
+
duration?: number;
|
|
69
|
+
errors?: VitestSerializedError[];
|
|
70
|
+
}
|
|
71
|
+
/** Vitest test case shape (minimal) */
|
|
72
|
+
interface VitestTestCase {
|
|
73
|
+
name: string;
|
|
74
|
+
meta: () => Record<string, unknown>;
|
|
75
|
+
result: () => VitestTestResult | undefined;
|
|
76
|
+
}
|
|
77
|
+
/** Vitest test module shape (minimal) */
|
|
78
|
+
interface VitestTestModule {
|
|
79
|
+
moduleId?: string;
|
|
80
|
+
relativeModuleId?: string;
|
|
81
|
+
children?: {
|
|
82
|
+
allTests: () => Iterable<VitestTestCase>;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Options for Vitest adapter */
|
|
86
|
+
interface VitestAdapterOptions {
|
|
87
|
+
/** Project root directory */
|
|
88
|
+
projectRoot?: string;
|
|
89
|
+
/** Package version */
|
|
90
|
+
packageVersion?: string;
|
|
91
|
+
/** Git SHA */
|
|
92
|
+
gitSha?: string;
|
|
93
|
+
/** Start time (epoch ms) */
|
|
94
|
+
startedAtMs?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Adapt Vitest test modules to RawRun.
|
|
98
|
+
*
|
|
99
|
+
* @param testModules - Vitest test modules
|
|
100
|
+
* @param options - Adapter options
|
|
101
|
+
* @returns RawRun for ACL processing
|
|
102
|
+
*/
|
|
103
|
+
declare function adaptVitestRun(testModules: ReadonlyArray<VitestTestModule>, options?: VitestAdapterOptions): RawRun;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Playwright Adapter - Layer 1.
|
|
107
|
+
*
|
|
108
|
+
* Transforms Playwright test results into RawRun.
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
/** Playwright test status */
|
|
112
|
+
type PlaywrightStatus = "passed" | "failed" | "skipped" | "timedOut" | "interrupted";
|
|
113
|
+
/** Playwright test error */
|
|
114
|
+
interface PlaywrightError {
|
|
115
|
+
message?: string;
|
|
116
|
+
stack?: string;
|
|
117
|
+
}
|
|
118
|
+
/** Playwright attachment */
|
|
119
|
+
interface PlaywrightAttachment {
|
|
120
|
+
name: string;
|
|
121
|
+
contentType: string;
|
|
122
|
+
path?: string;
|
|
123
|
+
body?: Buffer;
|
|
124
|
+
}
|
|
125
|
+
/** Playwright test result */
|
|
126
|
+
interface PlaywrightTestResult {
|
|
127
|
+
status: PlaywrightStatus;
|
|
128
|
+
duration: number;
|
|
129
|
+
errors: PlaywrightError[];
|
|
130
|
+
attachments: PlaywrightAttachment[];
|
|
131
|
+
retry: number;
|
|
132
|
+
/** Optional step events if caller captures Playwright step timing. */
|
|
133
|
+
stepEvents?: Array<{
|
|
134
|
+
index?: number;
|
|
135
|
+
stepId?: string;
|
|
136
|
+
title?: string;
|
|
137
|
+
status?: RawStatus;
|
|
138
|
+
durationMs?: number;
|
|
139
|
+
errorMessage?: string;
|
|
140
|
+
}>;
|
|
141
|
+
}
|
|
142
|
+
/** Playwright test case annotation */
|
|
143
|
+
interface PlaywrightAnnotation {
|
|
144
|
+
type: string;
|
|
145
|
+
description?: string;
|
|
146
|
+
}
|
|
147
|
+
/** Playwright test location */
|
|
148
|
+
interface PlaywrightLocation {
|
|
149
|
+
file: string;
|
|
150
|
+
line: number;
|
|
151
|
+
column: number;
|
|
152
|
+
}
|
|
153
|
+
/** Playwright test case shape (minimal) */
|
|
154
|
+
interface PlaywrightTestCase {
|
|
155
|
+
title: string;
|
|
156
|
+
titlePath: () => string[];
|
|
157
|
+
annotations: PlaywrightAnnotation[];
|
|
158
|
+
location: PlaywrightLocation;
|
|
159
|
+
retries: number;
|
|
160
|
+
}
|
|
161
|
+
/** Options for Playwright adapter */
|
|
162
|
+
interface PlaywrightAdapterOptions {
|
|
163
|
+
/** Project root directory */
|
|
164
|
+
projectRoot?: string;
|
|
165
|
+
/** Package version */
|
|
166
|
+
packageVersion?: string;
|
|
167
|
+
/** Git SHA */
|
|
168
|
+
gitSha?: string;
|
|
169
|
+
/** Start time (epoch ms) */
|
|
170
|
+
startedAtMs?: number;
|
|
171
|
+
/** Playwright project name */
|
|
172
|
+
projectName?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Adapt Playwright test results to RawRun.
|
|
176
|
+
*
|
|
177
|
+
* @param testResults - Array of [testCase, result] tuples
|
|
178
|
+
* @param options - Adapter options
|
|
179
|
+
* @returns RawRun for ACL processing
|
|
180
|
+
*/
|
|
181
|
+
declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun;
|
|
182
|
+
|
|
183
|
+
export { type JestAdapterOptions, type JestAggregatedResult, type JestFileResult, type JestTestResult, type PlaywrightAdapterOptions, type PlaywrightAnnotation, type PlaywrightAttachment, type PlaywrightError, type PlaywrightLocation, type PlaywrightStatus, type PlaywrightTestCase, type PlaywrightTestResult, type StoryFileReport, type VitestAdapterOptions, type VitestSerializedError, type VitestState, type VitestTestCase, type VitestTestModule, type VitestTestResult, adaptJestRun, adaptPlaywrightRun, adaptVitestRun };
|