@swedevtools/livedoc-vitest 0.2.0 → 0.3.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/CHANGELOG.md +34 -0
- package/LICENSE +20 -20
- package/README.md +160 -95
- package/dist/{RuleContext-BZhuy-zS.d.cts → RuleContext-DQ8o_n1D.d.ts} +62 -62
- package/dist/globals.d.ts +99 -99
- package/dist/{index-Blmp569T.d.cts → index-sbV15ohX.d.ts} +21 -2
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1062 -159
- package/dist/reporter/index.d.ts +2 -2
- package/dist/reporter/index.js +629 -84
- package/package.json +14 -12
- package/tools/livedoc-setup.mjs +172 -164
- package/tools/skills/SKILL.md +339 -244
- package/tools/skills/VALIDATION.md +37 -29
- package/tools/skills/examples/routing.md +75 -60
- package/tools/skills/resources/anti-patterns.md +19 -0
- package/tools/skills/resources/bdd-features.md +231 -231
- package/tools/skills/resources/partial-testing.md +77 -0
- package/tools/skills/resources/playwright.md +148 -148
- package/tools/skills/resources/reporter-config.md +213 -163
- package/tools/skills/resources/specifications.md +159 -159
- package/tools/skills/resources/test-strategy.md +103 -0
- package/tools/skills/resources/web-testing.md +62 -0
- package/dist/RuleContext-BZhuy-zS.d.ts +0 -206
- package/dist/globals.cjs +0 -2
- package/dist/globals.d.cts +0 -104
- package/dist/index-CysiWbtk.d.ts +0 -687
- package/dist/index.cjs +0 -10024
- package/dist/index.d.cts +0 -291
- package/dist/playwright/index.cjs +0 -103
- package/dist/playwright/index.d.cts +0 -129
- package/dist/reporter/index.cjs +0 -8676
- package/dist/reporter/index.d.cts +0 -7
- package/dist/setup.cjs +0 -14
- package/dist/setup.d.cts +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Reporter } from 'vitest/reporters';
|
|
2
2
|
import { File, TaskResultPack } from '@vitest/runner';
|
|
3
3
|
import { Vitest } from 'vitest/node';
|
|
4
|
-
import { D as DataTableRow, a as StepContext, F as FeatureContext, B as BackgroundContext, S as ScenarioContext, R as RuleContext, b as SpecificationContext } from './RuleContext-
|
|
5
|
-
import { Attachment, TestRunV1 } from '@swedevtools/livedoc-schema';
|
|
4
|
+
import { D as DataTableRow, a as StepContext, F as FeatureContext, B as BackgroundContext, S as ScenarioContext, R as RuleContext, b as SpecificationContext } from './RuleContext-DQ8o_n1D.js';
|
|
5
|
+
import { Attachment, RunType, CoverageMetricName, TestRunV1 } from '@swedevtools/livedoc-schema';
|
|
6
6
|
import { RunnerTestFile } from 'vitest';
|
|
7
7
|
|
|
8
8
|
declare enum RuleViolations {
|
|
@@ -343,11 +343,19 @@ declare class LiveDocSpecReporter implements Reporter {
|
|
|
343
343
|
private liveDocSpec;
|
|
344
344
|
private options;
|
|
345
345
|
private exportConfig;
|
|
346
|
+
private coverageContext;
|
|
346
347
|
private streamEnabled;
|
|
347
348
|
private taskById;
|
|
348
349
|
private streamedStates;
|
|
349
350
|
constructor(options?: any);
|
|
350
351
|
onInit(ctx: Vitest): Promise<void>;
|
|
352
|
+
onCoverage(coverageMap: unknown): void;
|
|
353
|
+
private captureCoverageContext;
|
|
354
|
+
private applyPublishEnvironmentOverrides;
|
|
355
|
+
private firstEnvironmentValue;
|
|
356
|
+
private discoverLiveDocServer;
|
|
357
|
+
private discoverDefaultLocalServer;
|
|
358
|
+
private isLiveDocServerHealthy;
|
|
351
359
|
onCollected(files?: File[]): void;
|
|
352
360
|
onTaskUpdate(packs: TaskResultPack[]): void;
|
|
353
361
|
private normalizeTaskResultPack;
|
|
@@ -361,6 +369,8 @@ declare class LiveDocSpecReporter implements Reporter {
|
|
|
361
369
|
private buildScenarioFromSuite;
|
|
362
370
|
private buildScenarioExampleFromSuite;
|
|
363
371
|
private getLiveDocMetaFromTask;
|
|
372
|
+
private isFilteredOutTask;
|
|
373
|
+
private hasUnfilteredLiveDocLeaf;
|
|
364
374
|
private findFirstLiveDocStepMetaInSuite;
|
|
365
375
|
private buildScenarioOutlineTablesFromMeta;
|
|
366
376
|
private parseTitleBlock;
|
|
@@ -464,11 +474,18 @@ interface LiveDocViewerOptions {
|
|
|
464
474
|
server?: string;
|
|
465
475
|
project?: string;
|
|
466
476
|
environment?: string;
|
|
477
|
+
runType?: RunType;
|
|
467
478
|
timeout?: number;
|
|
468
479
|
silent?: boolean;
|
|
480
|
+
coverage?: {
|
|
481
|
+
enabled?: boolean;
|
|
482
|
+
path?: string;
|
|
483
|
+
thresholds?: Partial<Record<CoverageMetricName, number>>;
|
|
484
|
+
};
|
|
469
485
|
}
|
|
470
486
|
declare class LiveDocViewerReporter implements IPostReporter {
|
|
471
487
|
private options;
|
|
488
|
+
private readonly hasExplicitRunType;
|
|
472
489
|
constructor(options?: LiveDocViewerOptions);
|
|
473
490
|
execute(results: ExecutionResults, rawOptions?: any): Promise<void>;
|
|
474
491
|
/**
|
|
@@ -481,6 +498,7 @@ declare class LiveDocViewerReporter implements IPostReporter {
|
|
|
481
498
|
completeRunFromResults(runId: string, results: ExecutionResults): Promise<void>;
|
|
482
499
|
private applyRawOptions;
|
|
483
500
|
private startRun;
|
|
501
|
+
private parseRunType;
|
|
484
502
|
private upsertTestCase;
|
|
485
503
|
private buildPathContext;
|
|
486
504
|
private findCommonRootPath;
|
|
@@ -509,6 +527,7 @@ declare class LiveDocViewerReporter implements IPostReporter {
|
|
|
509
527
|
private computeRuleOutlineStatistics;
|
|
510
528
|
private toTypedValue;
|
|
511
529
|
private completeRun;
|
|
530
|
+
private collectCoverage;
|
|
512
531
|
private mapStatus;
|
|
513
532
|
private calculateScenarioStatus;
|
|
514
533
|
private calculateOutlineStatus;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as Rule, S as Specification, T as Table, F as Feature, B as Background, a as Scenario, b as ScenarioOutline, c as StepDefinition } from './index-
|
|
2
|
-
export { C as ColorTheme, D as DefaultColorTheme, E as Exception, d as ExecutionResults, H as HeaderType, I as IPostReporter, J as JsonReporter, L as LiveDocReporter, e as LiveDocReporterOptions, f as LiveDocRuleViolation, g as LiveDocServerReporter, h as LiveDocSpec, g as LiveDocSpecReporter, i as LiveDocSuite, j as LiveDocTest, k as LiveDocViewerOptions, l as LiveDocViewerReporter, m as LiveDocVitestReporter, n as ReporterOptions, o as RuleViolations, p as ScenarioExample, q as ScenarioOutlineContext, r as SilentReporter, s as SpecStatus, t as Statistics, u as SuiteBase, V as VitestSuite } from './index-
|
|
3
|
-
import { D as DataTableRow, R as RuleContext } from './RuleContext-
|
|
4
|
-
export { B as BackgroundContext, F as FeatureContext, S as ScenarioContext, b as SpecificationContext, a as StepContext } from './RuleContext-
|
|
1
|
+
import { R as Rule, S as Specification, T as Table, F as Feature, B as Background, a as Scenario, b as ScenarioOutline, c as StepDefinition } from './index-sbV15ohX.js';
|
|
2
|
+
export { C as ColorTheme, D as DefaultColorTheme, E as Exception, d as ExecutionResults, H as HeaderType, I as IPostReporter, J as JsonReporter, L as LiveDocReporter, e as LiveDocReporterOptions, f as LiveDocRuleViolation, g as LiveDocServerReporter, h as LiveDocSpec, g as LiveDocSpecReporter, i as LiveDocSuite, j as LiveDocTest, k as LiveDocViewerOptions, l as LiveDocViewerReporter, m as LiveDocVitestReporter, n as ReporterOptions, o as RuleViolations, p as ScenarioExample, q as ScenarioOutlineContext, r as SilentReporter, s as SpecStatus, t as Statistics, u as SuiteBase, V as VitestSuite } from './index-sbV15ohX.js';
|
|
3
|
+
import { D as DataTableRow, R as RuleContext } from './RuleContext-DQ8o_n1D.js';
|
|
4
|
+
export { B as BackgroundContext, F as FeatureContext, S as ScenarioContext, b as SpecificationContext, a as StepContext } from './RuleContext-DQ8o_n1D.js';
|
|
5
5
|
import * as vitest from 'vitest';
|
|
6
6
|
import 'vitest/reporters';
|
|
7
7
|
import '@vitest/runner';
|
|
@@ -156,10 +156,12 @@ declare class FilterOptions {
|
|
|
156
156
|
declare class PublishOptions {
|
|
157
157
|
/** Server URL, e.g., 'http://localhost:3100' */
|
|
158
158
|
server: string;
|
|
159
|
-
/** Project name (defaults to '
|
|
159
|
+
/** Project name (defaults to 'livedoc') */
|
|
160
160
|
project: string;
|
|
161
161
|
/** Environment name (defaults to 'local') */
|
|
162
162
|
environment: string;
|
|
163
|
+
/** Whether the invocation reports the complete test inventory or a focused subset. */
|
|
164
|
+
runType: "full" | "partial";
|
|
163
165
|
/** Whether publishing is enabled */
|
|
164
166
|
enabled: boolean;
|
|
165
167
|
}
|