@vitest-agent/reporter 4.0.0 → 4.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/index.d.ts +25 -25
- package/index.js +1 -1
- package/liveView.js +10 -7
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -282,6 +282,31 @@ interface CellOptions {
|
|
|
282
282
|
*/
|
|
283
283
|
readonly osc8: (url: string, label: string) => string;
|
|
284
284
|
}
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/formatters/types.d.ts
|
|
287
|
+
/**
|
|
288
|
+
* One unit of rendered reporter output, tagged by where it goes.
|
|
289
|
+
*
|
|
290
|
+
* `stdout` writes to the process stdout stream, `github-summary`
|
|
291
|
+
* appends to the GitHub Actions step-summary file, and `file` is
|
|
292
|
+
* reserved for reporters that embed their own destination path.
|
|
293
|
+
*
|
|
294
|
+
* `report` writes `filename` into `.vitest/<scope>/` through Vitest 5's
|
|
295
|
+
* `createReport`. The plugin drops these when reporting is disabled,
|
|
296
|
+
* exactly as it drops `github-summary` outside GitHub Actions.
|
|
297
|
+
*
|
|
298
|
+
* @public
|
|
299
|
+
*/
|
|
300
|
+
type RenderedOutput = {
|
|
301
|
+
readonly target: "stdout" | "file" | "github-summary";
|
|
302
|
+
readonly content: string;
|
|
303
|
+
readonly contentType: string;
|
|
304
|
+
} | {
|
|
305
|
+
readonly target: "report";
|
|
306
|
+
readonly filename: string;
|
|
307
|
+
readonly content: string;
|
|
308
|
+
readonly contentType: string;
|
|
309
|
+
};
|
|
285
310
|
/**
|
|
286
311
|
* Complete per-project test report written to disk as JSON.
|
|
287
312
|
* @public
|
|
@@ -500,31 +525,6 @@ type OutputFormat = typeof OutputFormat.Type;
|
|
|
500
525
|
declare const DetailLevel: Schema.Literals<readonly ["minimal", "neutral", "standard", "verbose"]>;
|
|
501
526
|
/** @public */
|
|
502
527
|
type DetailLevel = typeof DetailLevel.Type;
|
|
503
|
-
//#endregion
|
|
504
|
-
//#region src/formatters/types.d.ts
|
|
505
|
-
/**
|
|
506
|
-
* One unit of rendered reporter output, tagged by where it goes.
|
|
507
|
-
*
|
|
508
|
-
* `stdout` writes to the process stdout stream, `github-summary`
|
|
509
|
-
* appends to the GitHub Actions step-summary file, and `file` is
|
|
510
|
-
* reserved for reporters that embed their own destination path.
|
|
511
|
-
*
|
|
512
|
-
* `report` writes `filename` into `.vitest/<scope>/` through Vitest 5's
|
|
513
|
-
* `createReport`. The plugin drops these when reporting is disabled,
|
|
514
|
-
* exactly as it drops `github-summary` outside GitHub Actions.
|
|
515
|
-
*
|
|
516
|
-
* @public
|
|
517
|
-
*/
|
|
518
|
-
type RenderedOutput = {
|
|
519
|
-
readonly target: "stdout" | "file" | "github-summary";
|
|
520
|
-
readonly content: string;
|
|
521
|
-
readonly contentType: string;
|
|
522
|
-
} | {
|
|
523
|
-
readonly target: "report";
|
|
524
|
-
readonly filename: string;
|
|
525
|
-
readonly content: string;
|
|
526
|
-
readonly contentType: string;
|
|
527
|
-
};
|
|
528
528
|
/**
|
|
529
529
|
* The reducer projects this union into `RenderState`. Renderers
|
|
530
530
|
* never read the raw event stream — they read the projected state.
|
package/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { DefaultVitestAgentReporter, buildDispatchInputs, renderAgentStringForRe
|
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
const CURRENT_REPORTER_VERSION = "4.
|
|
11
|
+
const CURRENT_REPORTER_VERSION = "4.1.0";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
export { CURRENT_REPORTER_VERSION, DefaultVitestAgentReporter, buildDispatchInputs, renderAgentStringForReport, renderHumanStringForReport, resolveCellOptions };
|
package/liveView.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CliEnv } from "@effected/cli";
|
|
1
|
+
import { CliEnv, Doc } from "@effected/cli";
|
|
2
2
|
import { CliUi } from "@effected/cli/ui";
|
|
3
3
|
import { initialRenderState } from "@vitest-agent/sdk";
|
|
4
|
-
import { SPINNER_FRAME_MS, StreamApp, reduceRenderState } from "@vitest-agent/ui";
|
|
4
|
+
import { SPINNER_FRAME_MS, StreamApp, reduceRenderState, renderAgent } from "@vitest-agent/ui";
|
|
5
5
|
import { Cause, Deferred, Effect, Exit, Layer, PubSub, Scope } from "effect";
|
|
6
6
|
import { createElement } from "react";
|
|
7
7
|
import * as NodeServices from "@effect/platform-node/NodeServices";
|
|
@@ -16,10 +16,12 @@ import * as NodeServices from "@effect/platform-node/NodeServices";
|
|
|
16
16
|
* says), redraws on every event and on an 80 ms tick, and commits its final
|
|
17
17
|
* frame to scrollback at the terminal event (`RunFinished` /
|
|
18
18
|
* `RunTimedOut`), never clearing the screen. The next run in watch mode
|
|
19
|
-
* mounts afresh below it. When the run is not interactive (piped,
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* mounts afresh below it. When the run is not interactive (piped, CI) nothing
|
|
20
|
+
* is mounted: each run's `final` document is written once to stdout instead,
|
|
21
|
+
* so a `vitest run | cat` still receives the result. That document is the
|
|
22
|
+
* plain report `renderAgent` builds from the same state (header, failures,
|
|
23
|
+
* modules, coverage, suggested actions), each line kept whole; it does not
|
|
24
|
+
* try to reproduce the Ink frame, and drawing it never renders through Ink.
|
|
23
25
|
*
|
|
24
26
|
* Lifetime: one scope per live view, held for the reporter's whole life. The
|
|
25
27
|
* subscription is made in it synchronously, before the factory returns, so
|
|
@@ -52,7 +54,8 @@ const liveViewOptions = {
|
|
|
52
54
|
isTerminal: (event) => event._tag === "RunFinished" || event._tag === "RunTimedOut",
|
|
53
55
|
begins: (event, before, after) => event._tag === "RunStarted" || before.phase === "idle" && after.phase !== "idle",
|
|
54
56
|
mode: "owned",
|
|
55
|
-
tickMillis: SPINNER_FRAME_MS
|
|
57
|
+
tickMillis: SPINNER_FRAME_MS,
|
|
58
|
+
final: (state) => renderAgent(state).trimEnd().split("\n").map((line) => Doc.line(line, { wrap: false }))
|
|
56
59
|
};
|
|
57
60
|
/**
|
|
58
61
|
* The environment a Vitest-hosted live view reads: the kit's `CliEnv` over
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/reporter",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Named VitestAgentReporterFactory implementations for the vitest-agent ecosystem.",
|
|
6
6
|
"keywords": [
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@effect/platform-node": "^4.0.0",
|
|
43
|
-
"@vitest-agent/sdk": "
|
|
44
|
-
"@vitest-agent/ui": "
|
|
43
|
+
"@vitest-agent/sdk": "6.0.0",
|
|
44
|
+
"@vitest-agent/ui": "4.0.1",
|
|
45
45
|
"effect": "^4.0.0",
|
|
46
46
|
"ink": "^7.1.1",
|
|
47
47
|
"react": "^19.3.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@effected/cli": "^0.
|
|
50
|
+
"@effected/cli": "^0.12.0",
|
|
51
51
|
"@effected/env": "^0.1.0",
|
|
52
52
|
"@effected/glob": "^0.10.0",
|
|
53
53
|
"@effected/walker": "^0.15.0",
|