repterm 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.
- package/dist/api/describe.d.ts +18 -0
- package/dist/api/describe.d.ts.map +1 -0
- package/dist/api/describe.js +33 -0
- package/dist/api/describe.js.map +1 -0
- package/dist/api/expect.d.ts +43 -0
- package/dist/api/expect.d.ts.map +1 -0
- package/dist/api/expect.js +167 -0
- package/dist/api/expect.js.map +1 -0
- package/dist/api/hooks.d.ts +178 -0
- package/dist/api/hooks.d.ts.map +1 -0
- package/dist/api/hooks.js +231 -0
- package/dist/api/hooks.js.map +1 -0
- package/dist/api/steps.d.ts +45 -0
- package/dist/api/steps.d.ts.map +1 -0
- package/dist/api/steps.js +106 -0
- package/dist/api/steps.js.map +1 -0
- package/dist/api/test.d.ts +101 -0
- package/dist/api/test.d.ts.map +1 -0
- package/dist/api/test.js +207 -0
- package/dist/api/test.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +203 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/reporter.d.ts +108 -0
- package/dist/cli/reporter.d.ts.map +1 -0
- package/dist/cli/reporter.js +368 -0
- package/dist/cli/reporter.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin/index.d.ts +47 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +86 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/withPlugins.d.ts +71 -0
- package/dist/plugin/withPlugins.d.ts.map +1 -0
- package/dist/plugin/withPlugins.js +101 -0
- package/dist/plugin/withPlugins.js.map +1 -0
- package/dist/recording/recorder.d.ts +45 -0
- package/dist/recording/recorder.d.ts.map +1 -0
- package/dist/recording/recorder.js +97 -0
- package/dist/recording/recorder.js.map +1 -0
- package/dist/runner/artifacts.d.ts +39 -0
- package/dist/runner/artifacts.d.ts.map +1 -0
- package/dist/runner/artifacts.js +59 -0
- package/dist/runner/artifacts.js.map +1 -0
- package/dist/runner/config.d.ts +46 -0
- package/dist/runner/config.d.ts.map +1 -0
- package/dist/runner/config.js +65 -0
- package/dist/runner/config.js.map +1 -0
- package/dist/runner/filter.d.ts +26 -0
- package/dist/runner/filter.d.ts.map +1 -0
- package/dist/runner/filter.js +88 -0
- package/dist/runner/filter.js.map +1 -0
- package/dist/runner/loader.d.ts +32 -0
- package/dist/runner/loader.d.ts.map +1 -0
- package/dist/runner/loader.js +252 -0
- package/dist/runner/loader.js.map +1 -0
- package/dist/runner/models.d.ts +261 -0
- package/dist/runner/models.d.ts.map +1 -0
- package/dist/runner/models.js +5 -0
- package/dist/runner/models.js.map +1 -0
- package/dist/runner/runner.d.ts +36 -0
- package/dist/runner/runner.d.ts.map +1 -0
- package/dist/runner/runner.js +216 -0
- package/dist/runner/runner.js.map +1 -0
- package/dist/runner/scheduler.d.ts +59 -0
- package/dist/runner/scheduler.d.ts.map +1 -0
- package/dist/runner/scheduler.js +157 -0
- package/dist/runner/scheduler.js.map +1 -0
- package/dist/runner/worker-runner.d.ts +6 -0
- package/dist/runner/worker-runner.d.ts.map +1 -0
- package/dist/runner/worker-runner.js +51 -0
- package/dist/runner/worker-runner.js.map +1 -0
- package/dist/runner/worker.d.ts +54 -0
- package/dist/runner/worker.d.ts.map +1 -0
- package/dist/runner/worker.js +112 -0
- package/dist/runner/worker.js.map +1 -0
- package/dist/terminal/session.d.ts +56 -0
- package/dist/terminal/session.d.ts.map +1 -0
- package/dist/terminal/session.js +126 -0
- package/dist/terminal/session.js.map +1 -0
- package/dist/terminal/terminal.d.ts +284 -0
- package/dist/terminal/terminal.d.ts.map +1 -0
- package/dist/terminal/terminal.js +1167 -0
- package/dist/terminal/terminal.js.map +1 -0
- package/dist/utils/dependencies.d.ts +19 -0
- package/dist/utils/dependencies.d.ts.map +1 -0
- package/dist/utils/dependencies.js +58 -0
- package/dist/utils/dependencies.js.map +1 -0
- package/dist/utils/timing.d.ts +55 -0
- package/dist/utils/timing.d.ts.map +1 -0
- package/dist/utils/timing.js +87 -0
- package/dist/utils/timing.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reporter with failure diagnostics
|
|
3
|
+
* Formats and displays test results in Vitest-style output
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Reporter for test results with Vitest-style formatting
|
|
7
|
+
*/
|
|
8
|
+
export class Reporter {
|
|
9
|
+
options;
|
|
10
|
+
slowThreshold;
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this.options = {
|
|
13
|
+
verbose: options.verbose ?? false,
|
|
14
|
+
colors: options.colors ?? true,
|
|
15
|
+
};
|
|
16
|
+
this.slowThreshold = options.slowThreshold ?? 50;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Track last suite path for header printing
|
|
20
|
+
*/
|
|
21
|
+
lastSuitePath = [];
|
|
22
|
+
/**
|
|
23
|
+
* Called when a test is about to start (before hooks run)
|
|
24
|
+
* Prints suite headers early to ensure proper output ordering
|
|
25
|
+
*/
|
|
26
|
+
onTestStart(testInfo) {
|
|
27
|
+
const currentPath = testInfo.suitePath;
|
|
28
|
+
// Determine how many suite levels match the previous test
|
|
29
|
+
let matchDepth = 0;
|
|
30
|
+
const maxDepth = Math.min(this.lastSuitePath.length, currentPath.length);
|
|
31
|
+
for (let i = 0; i < maxDepth; i++) {
|
|
32
|
+
if (this.lastSuitePath[i] === currentPath[i]) {
|
|
33
|
+
matchDepth++;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// Print headers for new suite levels
|
|
40
|
+
for (let i = matchDepth; i < currentPath.length; i++) {
|
|
41
|
+
const indent = ' '.repeat(i);
|
|
42
|
+
console.log(indent + this.color(currentPath[i], 'cyan'));
|
|
43
|
+
}
|
|
44
|
+
// Update state
|
|
45
|
+
this.lastSuitePath = currentPath;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Report a single test result immediately
|
|
49
|
+
*/
|
|
50
|
+
onTestResult(result) {
|
|
51
|
+
// Suite headers are already printed by onTestStart, so just print the test result
|
|
52
|
+
const depth = result.suitePath.length;
|
|
53
|
+
this.printTestResult(result, depth);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Report final summary and failures
|
|
57
|
+
*/
|
|
58
|
+
onRunComplete(results) {
|
|
59
|
+
// Print summary
|
|
60
|
+
this.printSummary(results);
|
|
61
|
+
// Print failure details
|
|
62
|
+
const failures = results.filter((r) => r.status === 'fail');
|
|
63
|
+
if (failures.length > 0) {
|
|
64
|
+
this.printFailures(failures);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Report all test results at once (Legacy/Batch mode)
|
|
69
|
+
*/
|
|
70
|
+
report(results) {
|
|
71
|
+
// Group results by top-level suite (first element of suitePath)
|
|
72
|
+
const suiteTree = this.buildSuiteTree(results);
|
|
73
|
+
// Print results recursively
|
|
74
|
+
for (const [suiteName, node] of suiteTree) {
|
|
75
|
+
this.printSuiteNode(suiteName, node, 0);
|
|
76
|
+
}
|
|
77
|
+
this.onRunComplete(results);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Build a tree of suites and tests
|
|
81
|
+
*/
|
|
82
|
+
buildSuiteTree(results) {
|
|
83
|
+
const tree = new Map();
|
|
84
|
+
for (const result of results) {
|
|
85
|
+
let currentMap = tree;
|
|
86
|
+
const path = result.suitePath;
|
|
87
|
+
// Navigate/build hierarchy
|
|
88
|
+
for (let i = 0; i < path.length; i++) {
|
|
89
|
+
const part = path[i];
|
|
90
|
+
if (!currentMap.has(part)) {
|
|
91
|
+
currentMap.set(part, {
|
|
92
|
+
name: part,
|
|
93
|
+
results: [],
|
|
94
|
+
children: new Map(),
|
|
95
|
+
durationMs: 0,
|
|
96
|
+
status: 'pass',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const node = currentMap.get(part);
|
|
100
|
+
node.durationMs += result.durationMs;
|
|
101
|
+
if (result.status === 'fail')
|
|
102
|
+
node.status = 'fail';
|
|
103
|
+
else if (result.status === 'skip' && node.status === 'pass')
|
|
104
|
+
node.status = 'skip';
|
|
105
|
+
// If this is the last part of the path, add the result here
|
|
106
|
+
if (i === path.length - 1) {
|
|
107
|
+
node.results.push(result);
|
|
108
|
+
}
|
|
109
|
+
currentMap = node.children;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return tree;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Print a suite node and its children recursively
|
|
116
|
+
*/
|
|
117
|
+
printSuiteNode(name, node, depth) {
|
|
118
|
+
const indent = ' '.repeat(depth);
|
|
119
|
+
// Calculate stats for this node (including children)
|
|
120
|
+
// Note: node.results only contains tests directly in this suite, but node.status/duration includes children
|
|
121
|
+
const symbol = this.getStatusSymbol(node.status);
|
|
122
|
+
const color = this.getStatusColor(node.status);
|
|
123
|
+
const count = this.countTests(node);
|
|
124
|
+
// Print suite header
|
|
125
|
+
console.log(indent +
|
|
126
|
+
this.color(` ${symbol} `, color) +
|
|
127
|
+
this.color(name, 'cyan') +
|
|
128
|
+
this.color(` (${count})`, 'dim') + // Simple count for now
|
|
129
|
+
this.color(` ${this.formatDuration(node.durationMs)}`, 'dim'));
|
|
130
|
+
// Print direct tests
|
|
131
|
+
for (const result of node.results) {
|
|
132
|
+
this.printTestResult(result, depth + 1);
|
|
133
|
+
}
|
|
134
|
+
// Print nested suites
|
|
135
|
+
for (const [childName, childNode] of node.children) {
|
|
136
|
+
this.printSuiteNode(childName, childNode, depth + 1);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Helper to count total tests in a node
|
|
141
|
+
*/
|
|
142
|
+
countTests(node) {
|
|
143
|
+
let count = node.results.length;
|
|
144
|
+
for (const child of node.children.values()) {
|
|
145
|
+
count += this.countTests(child);
|
|
146
|
+
}
|
|
147
|
+
return count;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Print a single test result
|
|
151
|
+
*/
|
|
152
|
+
printTestResult(result, depth) {
|
|
153
|
+
const indent = ' '.repeat(depth);
|
|
154
|
+
const testName = result.caseName || result.caseId;
|
|
155
|
+
const symbol = this.getStatusSymbol(result.status);
|
|
156
|
+
const color = this.getStatusColor(result.status);
|
|
157
|
+
// Only show duration for slower tests
|
|
158
|
+
const durationStr = result.durationMs >= this.slowThreshold
|
|
159
|
+
? this.color(` ${result.durationMs}ms`, 'dim')
|
|
160
|
+
: '';
|
|
161
|
+
// Show recording path if available
|
|
162
|
+
const recordingStr = result.recordingPath
|
|
163
|
+
? this.color(` → ${result.recordingPath}`, 'dim')
|
|
164
|
+
: '';
|
|
165
|
+
console.log(indent +
|
|
166
|
+
this.color(` ${symbol} `, color) +
|
|
167
|
+
this.color(testName, result.status === 'skip' ? 'dim' : 'white') +
|
|
168
|
+
durationStr +
|
|
169
|
+
recordingStr);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Print test summary in Vitest style
|
|
173
|
+
*/
|
|
174
|
+
printSummary(results) {
|
|
175
|
+
const passed = results.filter((r) => r.status === 'pass').length;
|
|
176
|
+
const failed = results.filter((r) => r.status === 'fail').length;
|
|
177
|
+
const skipped = results.filter((r) => r.status === 'skip').length;
|
|
178
|
+
const total = results.length;
|
|
179
|
+
const totalDuration = results.reduce((sum, r) => sum + r.durationMs, 0);
|
|
180
|
+
// Count unique suites
|
|
181
|
+
const suiteSet = new Set(results.map((r) => r.suiteName || r.suiteId));
|
|
182
|
+
const suitesPassed = Array.from(suiteSet).filter((suiteName) => {
|
|
183
|
+
const suiteResults = results.filter((r) => (r.suiteName || r.suiteId) === suiteName);
|
|
184
|
+
return suiteResults.every((r) => r.status !== 'fail');
|
|
185
|
+
}).length;
|
|
186
|
+
const suitesFailed = suiteSet.size - suitesPassed;
|
|
187
|
+
console.log('');
|
|
188
|
+
// Suites summary
|
|
189
|
+
const suiteSummary = this.formatSuiteSummary(suitesPassed, suitesFailed, suiteSet.size);
|
|
190
|
+
console.log(this.color(' Test Suites ', 'bold') + suiteSummary);
|
|
191
|
+
// Tests summary
|
|
192
|
+
const testSummary = this.formatTestSummary(passed, failed, skipped, total);
|
|
193
|
+
console.log(this.color(' Tests ', 'bold') + testSummary);
|
|
194
|
+
// Duration
|
|
195
|
+
console.log(this.color(' Duration ', 'bold') + this.formatDurationLong(totalDuration));
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Print failure details
|
|
199
|
+
*/
|
|
200
|
+
printFailures(failures) {
|
|
201
|
+
console.log('');
|
|
202
|
+
console.log(this.color(' FAIL ', 'bgRed') + this.color(' Failures', 'red'));
|
|
203
|
+
console.log('');
|
|
204
|
+
for (const failure of failures) {
|
|
205
|
+
const testName = failure.caseName || failure.caseId;
|
|
206
|
+
const suiteName = failure.suiteName || failure.suiteId;
|
|
207
|
+
console.log(this.color(`❯ ${suiteName} > ${testName}`, 'red'));
|
|
208
|
+
if (failure.error) {
|
|
209
|
+
console.log('');
|
|
210
|
+
console.log(this.color(` ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯`, 'dim'));
|
|
211
|
+
console.log(` ${failure.error.message}`);
|
|
212
|
+
if (failure.error.expected !== undefined && failure.error.actual !== undefined) {
|
|
213
|
+
console.log('');
|
|
214
|
+
console.log(this.color(' Expected: ', 'green') + this.formatValue(failure.error.expected));
|
|
215
|
+
console.log(this.color(' Received: ', 'red') + this.formatValue(failure.error.actual));
|
|
216
|
+
}
|
|
217
|
+
if (this.options.verbose && failure.error.commandLogs?.length) {
|
|
218
|
+
console.log('');
|
|
219
|
+
console.log(this.color(' Command logs:', 'dim'));
|
|
220
|
+
for (const log of failure.error.commandLogs) {
|
|
221
|
+
console.log(` $ ${log.command}`);
|
|
222
|
+
console.log(this.color(` exit=${log.code} duration=${log.duration}ms`, 'dim'));
|
|
223
|
+
if (log.stdout.trim()) {
|
|
224
|
+
console.log(this.color(' stdout:', 'dim'));
|
|
225
|
+
console.log(this.formatIndentedBlock(log.stdout, ' '));
|
|
226
|
+
}
|
|
227
|
+
if (log.stderr.trim()) {
|
|
228
|
+
console.log(this.color(' stderr:', 'dim'));
|
|
229
|
+
console.log(this.formatIndentedBlock(log.stderr, ' '));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (failure.error.stack && this.options.verbose) {
|
|
234
|
+
console.log('');
|
|
235
|
+
console.log(this.color(' Stack:', 'dim'));
|
|
236
|
+
console.log(failure.error.stack
|
|
237
|
+
.split('\n')
|
|
238
|
+
.map((line) => ` ${line}`)
|
|
239
|
+
.join('\n'));
|
|
240
|
+
}
|
|
241
|
+
console.log(this.color(` ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯`, 'dim'));
|
|
242
|
+
}
|
|
243
|
+
console.log('');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Format suite summary line
|
|
248
|
+
*/
|
|
249
|
+
formatSuiteSummary(passed, failed, total) {
|
|
250
|
+
const parts = [];
|
|
251
|
+
if (failed > 0) {
|
|
252
|
+
parts.push(this.color(`${failed} failed`, 'red'));
|
|
253
|
+
}
|
|
254
|
+
if (passed > 0) {
|
|
255
|
+
parts.push(this.color(`${passed} passed`, 'green'));
|
|
256
|
+
}
|
|
257
|
+
parts.push(`(${total})`);
|
|
258
|
+
return parts.join(' | ');
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Format test summary line
|
|
262
|
+
*/
|
|
263
|
+
formatTestSummary(passed, failed, skipped, total) {
|
|
264
|
+
const parts = [];
|
|
265
|
+
if (failed > 0) {
|
|
266
|
+
parts.push(this.color(`${failed} failed`, 'red'));
|
|
267
|
+
}
|
|
268
|
+
if (skipped > 0) {
|
|
269
|
+
parts.push(this.color(`${skipped} skipped`, 'yellow'));
|
|
270
|
+
}
|
|
271
|
+
if (passed > 0) {
|
|
272
|
+
parts.push(this.color(`${passed} passed`, 'green'));
|
|
273
|
+
}
|
|
274
|
+
parts.push(`(${total})`);
|
|
275
|
+
return parts.join(' | ');
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Get status symbol
|
|
279
|
+
*/
|
|
280
|
+
getStatusSymbol(status) {
|
|
281
|
+
switch (status) {
|
|
282
|
+
case 'pass':
|
|
283
|
+
return '✓';
|
|
284
|
+
case 'fail':
|
|
285
|
+
return '✗';
|
|
286
|
+
case 'skip':
|
|
287
|
+
return '○';
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Get status color
|
|
292
|
+
*/
|
|
293
|
+
getStatusColor(status) {
|
|
294
|
+
switch (status) {
|
|
295
|
+
case 'pass':
|
|
296
|
+
return 'green';
|
|
297
|
+
case 'fail':
|
|
298
|
+
return 'red';
|
|
299
|
+
case 'skip':
|
|
300
|
+
return 'yellow';
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Format duration (short)
|
|
305
|
+
*/
|
|
306
|
+
formatDuration(ms) {
|
|
307
|
+
if (ms < 1000) {
|
|
308
|
+
return `${ms}ms`;
|
|
309
|
+
}
|
|
310
|
+
return `${(ms / 1000).toFixed(2)}s`;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Format duration (long, for summary)
|
|
314
|
+
*/
|
|
315
|
+
formatDurationLong(ms) {
|
|
316
|
+
if (ms < 1000) {
|
|
317
|
+
return `${ms}ms`;
|
|
318
|
+
}
|
|
319
|
+
const seconds = (ms / 1000).toFixed(2);
|
|
320
|
+
return `${seconds}s`;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Format value for diff display
|
|
324
|
+
*/
|
|
325
|
+
formatValue(value) {
|
|
326
|
+
if (typeof value === 'string') {
|
|
327
|
+
return `"${value}"`;
|
|
328
|
+
}
|
|
329
|
+
return JSON.stringify(value);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Indent multi-line text blocks for verbose diagnostics
|
|
333
|
+
*/
|
|
334
|
+
formatIndentedBlock(text, indent) {
|
|
335
|
+
return text
|
|
336
|
+
.replace(/\n+$/, '')
|
|
337
|
+
.split('\n')
|
|
338
|
+
.map((line) => `${indent}${line}`)
|
|
339
|
+
.join('\n');
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Apply color to text
|
|
343
|
+
*/
|
|
344
|
+
color(text, color) {
|
|
345
|
+
if (!this.options.colors) {
|
|
346
|
+
return text;
|
|
347
|
+
}
|
|
348
|
+
const codes = {
|
|
349
|
+
green: '\x1b[32m',
|
|
350
|
+
red: '\x1b[31m',
|
|
351
|
+
yellow: '\x1b[33m',
|
|
352
|
+
cyan: '\x1b[36m',
|
|
353
|
+
dim: '\x1b[2m',
|
|
354
|
+
bold: '\x1b[1m',
|
|
355
|
+
white: '\x1b[37m',
|
|
356
|
+
bgRed: '\x1b[41m\x1b[37m',
|
|
357
|
+
};
|
|
358
|
+
const reset = '\x1b[0m';
|
|
359
|
+
return `${codes[color]}${text}${reset}`;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Create a reporter
|
|
364
|
+
*/
|
|
365
|
+
export function createReporter(options) {
|
|
366
|
+
return new Reporter(options);
|
|
367
|
+
}
|
|
368
|
+
//# sourceMappingURL=repor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AAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACK,KAAK,CACX,IAAY,EACZ,KAA+E;QAE/E,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAA2B;YACpC,KAAK,EAAE,UAAU;YACjB,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,kBAAkB;SAC1B,CAAC;QAEF,MAAM,KAAK,GAAG,SAAS,CAAC;QACxB,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC;IAC1C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAyB;IACtD,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repterm - CLI/TUI Test Framework
|
|
3
|
+
*
|
|
4
|
+
* Public API entrypoint following Modern, Declarative conventions
|
|
5
|
+
*/
|
|
6
|
+
export { test, getTests, clearTests, registry } from './api/test.js';
|
|
7
|
+
export { expect, AssertionError, type MatcherResult, } from './api/expect.js';
|
|
8
|
+
export { describe } from './api/describe.js';
|
|
9
|
+
export { step, getCurrentStepOptions, getCurrentStepName, shouldShowStepTitle, markStepTitleShown, type StepRecordingOptions } from './api/steps.js';
|
|
10
|
+
export { beforeEach, afterEach, beforeAll, afterAll } from './api/hooks.js';
|
|
11
|
+
export type { TestContext, TerminalAPI, WaitOptions, CommandResult, RunOptions, PTYProcess, NamedHookEntry, PluginFactory, TerminalWithPlugins } from './runner/models.js';
|
|
12
|
+
export type { TestFunction, TestOptions, DescribeOptions } from './runner/models.js';
|
|
13
|
+
export type { HookFunction, EnhancedHookFunction } from './api/hooks.js';
|
|
14
|
+
export { definePlugin, defineConfig, createTestWithPlugins, describeWithPlugins, type PluginDefinition, type AnyPlugin, type PluginConfig, type PluginHooks, type BasePluginContext, type AugmentedTestContext, type PluginTestFunction, } from './plugin/index.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,MAAM,EACN,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,IAAI,EACJ,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG5E,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC3K,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrF,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGzE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repterm - CLI/TUI Test Framework
|
|
3
|
+
*
|
|
4
|
+
* Public API entrypoint following Modern, Declarative conventions
|
|
5
|
+
*/
|
|
6
|
+
// Core test registration and execution
|
|
7
|
+
export { test, getTests, clearTests, registry } from './api/test.js';
|
|
8
|
+
export { expect, AssertionError, } from './api/expect.js';
|
|
9
|
+
// Test organization features
|
|
10
|
+
export { describe } from './api/describe.js';
|
|
11
|
+
export { step, getCurrentStepOptions, getCurrentStepName, shouldShowStepTitle, markStepTitleShown } from './api/steps.js';
|
|
12
|
+
export { beforeEach, afterEach, beforeAll, afterAll } from './api/hooks.js';
|
|
13
|
+
// Plugin system
|
|
14
|
+
export { definePlugin, defineConfig, createTestWithPlugins, describeWithPlugins, } from './plugin/index.js';
|
|
15
|
+
// Attach step to test namespace for test.step() syntax
|
|
16
|
+
import { test as testFn } from './api/test.js';
|
|
17
|
+
import { step as stepFn } from './api/steps.js';
|
|
18
|
+
import { describe as describeFn } from './api/describe.js';
|
|
19
|
+
// Extend test with additional methods
|
|
20
|
+
Object.assign(testFn, {
|
|
21
|
+
step: stepFn,
|
|
22
|
+
describe: describeFn,
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,MAAM,EACN,cAAc,GAEf,MAAM,iBAAiB,CAAC;AAEzB,6BAA6B;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,IAAI,EACJ,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO5E,gBAAgB;AAChB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,GAQpB,MAAM,mBAAmB,CAAC;AAE3B,uDAAuD;AACvD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,sCAAsC;AACtC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repterm Plugin System
|
|
3
|
+
*
|
|
4
|
+
* A type-safe plugin system that allows extending test contexts and terminal APIs.
|
|
5
|
+
* Types and definePlugin come from @repterm/plugin-api; runtime lives here.
|
|
6
|
+
*/
|
|
7
|
+
import type { TestContext } from '../runner/models.js';
|
|
8
|
+
import { definePlugin as definePluginFromApi, type BasePluginContext as BasePluginContextGeneric, type PluginHooks, type PluginDefinition, type AnyPlugin } from '@repterm/plugin-api';
|
|
9
|
+
export { definePluginFromApi as definePlugin };
|
|
10
|
+
export type { PluginDefinition, AnyPlugin, PluginHooks };
|
|
11
|
+
export type BasePluginContext = BasePluginContextGeneric<TestContext>;
|
|
12
|
+
type ExtractContextOut<T> = T extends PluginDefinition<any, any, infer Out, any> ? Out : {};
|
|
13
|
+
type ExtractMethods<T> = T extends PluginDefinition<any, any, any, infer M> ? M : {};
|
|
14
|
+
type ExtractName<T> = T extends PluginDefinition<infer N, any, any, any> ? N : never;
|
|
15
|
+
type MergePluginMethods<TPlugins extends readonly AnyPlugin[]> = TPlugins extends readonly [
|
|
16
|
+
infer First,
|
|
17
|
+
...infer Rest
|
|
18
|
+
] ? Rest extends readonly AnyPlugin[] ? {
|
|
19
|
+
[K in ExtractName<First>]: ExtractMethods<First>;
|
|
20
|
+
} & MergePluginMethods<Rest> : {
|
|
21
|
+
[K in ExtractName<First>]: ExtractMethods<First>;
|
|
22
|
+
} : {};
|
|
23
|
+
type AccumulateContext<TPlugins extends readonly AnyPlugin[], TAccum extends object = {}> = TPlugins extends readonly [infer First, ...infer Rest] ? Rest extends readonly AnyPlugin[] ? AccumulateContext<Rest, TAccum & ExtractContextOut<First>> : TAccum & ExtractContextOut<First> : TAccum;
|
|
24
|
+
export type AugmentedTestContext<TPlugins extends readonly AnyPlugin[]> = TestContext & {
|
|
25
|
+
plugins: MergePluginMethods<TPlugins>;
|
|
26
|
+
} & AccumulateContext<TPlugins>;
|
|
27
|
+
export interface PluginConfig<TPlugins extends readonly AnyPlugin[]> {
|
|
28
|
+
plugins?: TPlugins;
|
|
29
|
+
baseContext?: Partial<Omit<BasePluginContextGeneric<TestContext>, 'testContext'>>;
|
|
30
|
+
}
|
|
31
|
+
export declare class PluginRuntime<TPlugins extends readonly AnyPlugin[]> {
|
|
32
|
+
private plugins;
|
|
33
|
+
private baseContext;
|
|
34
|
+
private pluginMethods;
|
|
35
|
+
private pluginHooks;
|
|
36
|
+
private contextAugmentations;
|
|
37
|
+
constructor(config: PluginConfig<TPlugins>);
|
|
38
|
+
initialize(testContext: TestContext): AugmentedTestContext<TPlugins>;
|
|
39
|
+
runBeforeTestHooks(ctx: TestContext): Promise<void>;
|
|
40
|
+
runAfterTestHooks(ctx: TestContext, error?: Error): Promise<void>;
|
|
41
|
+
runBeforeCommandHooks(command: string): Promise<string>;
|
|
42
|
+
runAfterOutputHooks(output: string): Promise<string>;
|
|
43
|
+
}
|
|
44
|
+
export declare function defineConfig<TPlugins extends readonly AnyPlugin[]>(config: PluginConfig<TPlugins>): PluginRuntime<TPlugins>;
|
|
45
|
+
export { BasePluginContext as PluginContext };
|
|
46
|
+
export { createTestWithPlugins, describeWithPlugins, type PluginTestFunction, } from './withPlugins.js';
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,KAAK,iBAAiB,IAAI,wBAAwB,EAClD,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,mBAAmB,IAAI,YAAY,EAAE,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;AAItE,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AAC5F,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AACrF,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAErF,KAAK,kBAAkB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,IAAI,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AAkC;IACrD,OAAO,CAAC,oBAAoB,CAA+B;gBAE/C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC;IAS1C,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,oBAAoB,CAAC,QAAQ,CAAC;IAgC9D,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnD,iBAAiB,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjE,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAUvD,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAS3D;AAED,wBAAgB,YAAY,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EAChE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC7B,aAAa,CAAC,QAAQ,CAAC,CAEzB;AAED,OAAO,EAAE,iBAAiB,IAAI,aAAa,EAAE,CAAC;AAE9C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repterm Plugin System
|
|
3
|
+
*
|
|
4
|
+
* A type-safe plugin system that allows extending test contexts and terminal APIs.
|
|
5
|
+
* Types and definePlugin come from @repterm/plugin-api; runtime lives here.
|
|
6
|
+
*/
|
|
7
|
+
import { definePlugin as definePluginFromApi, } from '@repterm/plugin-api';
|
|
8
|
+
// Re-export plugin-api for consumers (repterm re-exports these from index)
|
|
9
|
+
export { definePluginFromApi as definePlugin };
|
|
10
|
+
// ============== Runtime Implementation ==============
|
|
11
|
+
export class PluginRuntime {
|
|
12
|
+
plugins;
|
|
13
|
+
baseContext;
|
|
14
|
+
pluginMethods = {};
|
|
15
|
+
pluginHooks = [];
|
|
16
|
+
contextAugmentations = {};
|
|
17
|
+
constructor(config) {
|
|
18
|
+
this.plugins = (config.plugins || []);
|
|
19
|
+
this.baseContext = {
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
debug: false,
|
|
22
|
+
...config.baseContext,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
initialize(testContext) {
|
|
26
|
+
const fullContext = {
|
|
27
|
+
...this.baseContext,
|
|
28
|
+
testContext,
|
|
29
|
+
};
|
|
30
|
+
let ctx = { ...fullContext };
|
|
31
|
+
for (const plugin of this.plugins) {
|
|
32
|
+
const result = plugin.setup(ctx);
|
|
33
|
+
this.pluginMethods[plugin.name] = result.methods;
|
|
34
|
+
if (result.hooks) {
|
|
35
|
+
this.pluginHooks.push(result.hooks);
|
|
36
|
+
}
|
|
37
|
+
if (result.context) {
|
|
38
|
+
ctx = { ...ctx, ...result.context };
|
|
39
|
+
Object.assign(this.contextAugmentations, result.context);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const augmentedContext = {
|
|
43
|
+
...testContext,
|
|
44
|
+
plugins: this.pluginMethods,
|
|
45
|
+
...this.contextAugmentations,
|
|
46
|
+
};
|
|
47
|
+
return augmentedContext;
|
|
48
|
+
}
|
|
49
|
+
async runBeforeTestHooks(ctx) {
|
|
50
|
+
for (const hooks of this.pluginHooks) {
|
|
51
|
+
if (hooks.beforeTest) {
|
|
52
|
+
await hooks.beforeTest(ctx);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async runAfterTestHooks(ctx, error) {
|
|
57
|
+
for (const hooks of this.pluginHooks) {
|
|
58
|
+
if (hooks.afterTest) {
|
|
59
|
+
await hooks.afterTest(ctx, error);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async runBeforeCommandHooks(command) {
|
|
64
|
+
let result = command;
|
|
65
|
+
for (const hooks of this.pluginHooks) {
|
|
66
|
+
if (hooks.beforeCommand) {
|
|
67
|
+
result = await hooks.beforeCommand(result);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
async runAfterOutputHooks(output) {
|
|
73
|
+
let result = output;
|
|
74
|
+
for (const hooks of this.pluginHooks) {
|
|
75
|
+
if (hooks.afterOutput) {
|
|
76
|
+
result = await hooks.afterOutput(result);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export function defineConfig(config) {
|
|
83
|
+
return new PluginRuntime(config);
|
|
84
|
+
}
|
|
85
|
+
export { createTestWithPlugins, describeWithPlugins, } from './withPlugins.js';
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,YAAY,IAAI,mBAAmB,GAKpC,MAAM,qBAAqB,CAAC;AAE7B,2EAA2E;AAC3E,OAAO,EAAE,mBAAmB,IAAI,YAAY,EAAE,CAAC;AAuC/C,uDAAuD;AAEvD,MAAM,OAAO,aAAa;IAChB,OAAO,CAAW;IAClB,WAAW,CAA6D;IACxE,aAAa,GAAwB,EAAE,CAAC;IACxC,WAAW,GAA+B,EAAE,CAAC;IAC7C,oBAAoB,GAA4B,EAAE,CAAC;IAE3D,YAAY,MAA8B;QACxC,IAAI,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAa,CAAC;QAClD,IAAI,CAAC,WAAW,GAAG;YACjB,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,KAAK;YACZ,GAAG,MAAM,CAAC,WAAW;SACtB,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,WAAwB;QACjC,MAAM,WAAW,GAA0C;YACzD,GAAG,IAAI,CAAC,WAAW;YACnB,WAAW;SACZ,CAAC;QAEF,IAAI,GAAG,GAAQ,EAAE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H,CAAC;IACH,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,OAAe;QACzC,IAAI,MAAM,GAAG,OAAO,CAAC;QACrB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;gBACxB,MAAM,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAAc;QACtC,IAAI,MAAM,GAAG,MAAM,CAAC;QACpB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;gBACtB,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,MAAM,UAAU,YAAY,CAC1B,MAA8B;IAE9B,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAID,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Integration Helpers
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities to seamlessly integrate plugins with the test framework,
|
|
5
|
+
* eliminating the need for manual initialization in every test case.
|
|
6
|
+
*/
|
|
7
|
+
import { describe as describeFromDescribe } from '../api/describe.js';
|
|
8
|
+
import type { PluginRuntime, AnyPlugin, AugmentedTestContext } from './index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Type for the augmented test function that receives plugin context
|
|
11
|
+
*/
|
|
12
|
+
export type PluginTestFunction<TPlugins extends readonly AnyPlugin[]> = (ctx: AugmentedTestContext<TPlugins>) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a test function that automatically initializes plugins
|
|
15
|
+
*
|
|
16
|
+
* @param config - The plugin runtime configuration
|
|
17
|
+
* @returns A wrapped test function with automatic plugin initialization
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { defineConfig } from 'repterm';
|
|
22
|
+
* import { createTestWithPlugins } from 'repterm/plugin/withPlugins';
|
|
23
|
+
* import { loggerPlugin } from './plugins/logger';
|
|
24
|
+
*
|
|
25
|
+
* const config = defineConfig({
|
|
26
|
+
* plugins: [loggerPlugin()] as const,
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* const test = createTestWithPlugins(config);
|
|
30
|
+
*
|
|
31
|
+
* test('my test', async (ctx) => {
|
|
32
|
+
* // ctx automatically includes all plugins!
|
|
33
|
+
* ctx.logger.info('Hello!');
|
|
34
|
+
* ctx.plugins.logger.log('info', 'World!');
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function createTestWithPlugins<TPlugins extends readonly AnyPlugin[]>(config: PluginRuntime<TPlugins>): (name: string, fn: PluginTestFunction<TPlugins>) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a describe block where all tests automatically have plugin access
|
|
41
|
+
*
|
|
42
|
+
* @param config - The plugin runtime configuration
|
|
43
|
+
* @param name - The describe block name
|
|
44
|
+
* @param fn - The describe block callback
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { defineConfig } from 'repterm';
|
|
49
|
+
* import { describeWithPlugins } from 'repterm/plugin/withPlugins';
|
|
50
|
+
* import { loggerPlugin } from './plugins/logger';
|
|
51
|
+
*
|
|
52
|
+
* const config = defineConfig({
|
|
53
|
+
* plugins: [loggerPlugin()] as const,
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* describeWithPlugins(config, 'My Suite', ({ test }) => {
|
|
57
|
+
* test('test 1', async (ctx) => {
|
|
58
|
+
* ctx.logger.info('Auto-initialized!');
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* test('test 2', async (ctx) => {
|
|
62
|
+
* ctx.logger.debug('Same here!');
|
|
63
|
+
* });
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function describeWithPlugins<TPlugins extends readonly AnyPlugin[]>(config: PluginRuntime<TPlugins>, name: string, fn: (helpers: {
|
|
68
|
+
test: ReturnType<typeof createTestWithPlugins<TPlugins>>;
|
|
69
|
+
describe: typeof describeFromDescribe;
|
|
70
|
+
}) => void): void;
|
|
71
|
+
//# sourceMappingURL=withPlugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withPlugins.d.ts","sourceRoot":"","sources":["../../src/plugin/withPlugins.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEjF;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,IAAI,CACpE,GAAG,EAAE,oBAAoB,CAAC,QAAQ,CAAC,KAClC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACvE,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,UAMrB,MAAM,MACR,kBAAkB,CAAC,QAAQ,CAAC,KACjC,IAAI,CAiCV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACrE,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAC/B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,OAAO,EAAE;IACV,IAAI,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzD,QAAQ,EAAE,OAAO,oBAAoB,CAAC;CACzC,KAAK,IAAI,GACX,IAAI,CAKN"}
|