@elench/testkit 0.1.133 → 0.1.135

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.
@@ -0,0 +1,27 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+
3
+ export default class GuardUnsafeEntrypointCommand extends Command {
4
+ static summary = "Fail a local script that must be run through Testkit";
5
+
6
+ static flags = {
7
+ command: Flags.string({
8
+ char: "c",
9
+ description: "Disabled command name shown in the error message",
10
+ required: true,
11
+ }),
12
+ use: Flags.string({
13
+ char: "u",
14
+ description: "Replacement command shown in the error message",
15
+ required: true,
16
+ }),
17
+ };
18
+
19
+ async run() {
20
+ const { flags } = await this.parse(GuardUnsafeEntrypointCommand);
21
+ this.error(
22
+ `${flags.command} is disabled because DB-touching tests must run through the isolated testkit harness.\n` +
23
+ `Use ${flags.use} instead.`,
24
+ { exit: 1 }
25
+ );
26
+ }
27
+ }
@@ -16,6 +16,7 @@ export function normalizeCliArgs(argv) {
16
16
  "lint",
17
17
  "browser",
18
18
  "db",
19
+ "guard",
19
20
  ]);
20
21
  const runTypeShortcuts = new Set(publicTestTypeList({ includeAll: true }));
21
22
  const valueFlags = new Set([
@@ -40,9 +41,12 @@ export function normalizeCliArgs(argv) {
40
41
  "--provider-arg",
41
42
  "--message",
42
43
  "--prompt",
44
+ "--command",
45
+ "--use",
43
46
  ]);
44
47
  const positionals = findPositionals(argv, valueFlags);
45
48
  const firstPositional = positionals[0] || null;
49
+ const explicitTopLevelCommand = topLevelCommands.has(firstPositional?.value);
46
50
  const forcedInteractiveAssistant = process.env.TESTKIT_FORCE_INTERACTIVE_ASSISTANT === "1";
47
51
  const interactiveTty = process.stdout.isTTY || forcedInteractiveAssistant;
48
52
  const assistantDefaultDisabled = process.env.TESTKIT_NO_ASSISTANT_DEFAULT === "1";
@@ -66,10 +70,11 @@ export function normalizeCliArgs(argv) {
66
70
  ].includes(value)
67
71
  );
68
72
  const shouldPrefixRun =
69
- (!firstPositional && !interactiveTty) ||
70
- runTypeShortcuts.has(firstPositional?.value) ||
71
- runFlagPresent ||
72
- !topLevelCommands.has(firstPositional?.value);
73
+ !explicitTopLevelCommand &&
74
+ ((!firstPositional && !interactiveTty) ||
75
+ runTypeShortcuts.has(firstPositional?.value) ||
76
+ runFlagPresent ||
77
+ !topLevelCommands.has(firstPositional?.value));
73
78
 
74
79
  if (!firstPositional && interactiveTty && !runFlagPresent && !assistantDefaultDisabled) {
75
80
  return ["assistant", ...argv];
@@ -96,7 +96,7 @@ export async function materializePostgresBinding(context = {}) {
96
96
 
97
97
  const assignments = columns.map((column) => {
98
98
  const identifier = requireIdentifier(column, `materializePostgresBinding.args.values.${column}`);
99
- return `${identifier} = ${toSqlLiteral(values[column])}`;
99
+ return `${identifier} = ${toSqlExpression(values[column], context)}`;
100
100
  });
101
101
  const query =
102
102
  `with updated as (update ${table} set ${assignments.join(", ")} ` +
@@ -166,6 +166,7 @@ export async function verifyLocalSchemaMatchesSource(config, databaseUrl, state,
166
166
  return { status: "skipped" };
167
167
  }
168
168
 
169
+ clearSchemaMismatchDiagnosticsForService(config);
169
170
  const sourceSchema = readSourceSchemaCacheText(state.cachePath);
170
171
  const localSchema = await captureTemplateSnapshotText(config, databaseUrl, {
171
172
  reporter: options.reporter || null,
@@ -174,7 +175,7 @@ export async function verifyLocalSchemaMatchesSource(config, databaseUrl, state,
174
175
  return { status: "matched" };
175
176
  }
176
177
 
177
- const diagnostics = await writeSchemaMismatchDiagnostics(config, state.cachePath, sourceSchema, localSchema);
178
+ const diagnostics = await writeSchemaMismatchDiagnostics(config, state, sourceSchema, localSchema);
178
179
  return {
179
180
  status: "mismatch",
180
181
  diagnostics,
@@ -396,21 +397,73 @@ function readJson(filePath) {
396
397
  }
397
398
  }
398
399
 
399
- async function writeSchemaMismatchDiagnostics(config, sourceCachePath, sourceSchema, localSchema) {
400
- const dir = path.join(config.productDir, ".testkit", "results", "schema");
400
+ function schemaMismatchDiagnosticsDir(config) {
401
+ return path.join(config.productDir, ".testkit", "results", "schema");
402
+ }
403
+
404
+ function schemaMismatchDiagnosticsPrefix(config) {
405
+ return `${sanitizePathSegment(config.runtimeLabel || config.name)}__${sanitizePathSegment(config.name)}`;
406
+ }
407
+
408
+ function clearSchemaMismatchDiagnosticsForService(config) {
409
+ const dir = schemaMismatchDiagnosticsDir(config);
410
+ if (!fs.existsSync(dir)) return;
411
+ const serviceSegment = sanitizePathSegment(config.name);
412
+ for (const entry of fs.readdirSync(dir)) {
413
+ if (!isSchemaMismatchDiagnosticForService(entry, serviceSegment)) continue;
414
+ fs.rmSync(path.join(dir, entry), { force: true });
415
+ }
416
+ }
417
+
418
+ function isSchemaMismatchDiagnosticForService(entry, serviceSegment) {
419
+ for (const suffix of [
420
+ "__source-schema.sql",
421
+ "__local-replay-schema.sql",
422
+ "__schema.diff",
423
+ "__schema.meta.json",
424
+ ]) {
425
+ if (!entry.endsWith(suffix)) continue;
426
+ return entry.slice(0, -suffix.length).endsWith(`__${serviceSegment}`);
427
+ }
428
+ return false;
429
+ }
430
+
431
+ async function writeSchemaMismatchDiagnostics(config, state, sourceSchema, localSchema) {
432
+ const dir = schemaMismatchDiagnosticsDir(config);
401
433
  fs.mkdirSync(dir, { recursive: true });
402
- const prefix = `${sanitizePathSegment(config.runtimeLabel || config.name)}__${sanitizePathSegment(config.name)}`;
434
+ const prefix = schemaMismatchDiagnosticsPrefix(config);
403
435
  const sourcePath = path.join(dir, `${prefix}__source-schema.sql`);
404
436
  const localPath = path.join(dir, `${prefix}__local-replay-schema.sql`);
405
437
  const diffPath = path.join(dir, `${prefix}__schema.diff`);
438
+ const metaPath = path.join(dir, `${prefix}__schema.meta.json`);
406
439
  fs.writeFileSync(sourcePath, sourceSchema);
407
440
  fs.writeFileSync(localPath, localSchema);
408
441
  fs.writeFileSync(diffPath, await buildUnifiedDiff(sourcePath, localPath));
442
+ writeJson(metaPath, buildSchemaMismatchMetadata(config, state));
409
443
  return {
410
- sourceCachePath,
444
+ sourceCachePath: state.cachePath,
411
445
  sourcePath,
412
446
  localPath,
413
447
  diffPath,
448
+ metaPath,
449
+ };
450
+ }
451
+
452
+ function buildSchemaMismatchMetadata(config, state) {
453
+ const sourceMetadata = readJson(state.metadataPath) || {};
454
+ return {
455
+ version: 1,
456
+ createdAt: new Date().toISOString(),
457
+ serviceName: config.name,
458
+ runtimeLabel: config.runtimeLabel || config.name,
459
+ sourceSchema: {
460
+ envName: state.envName || null,
461
+ cacheKey: state.cacheKey || null,
462
+ cacheKind: state.cacheKind || null,
463
+ cachePath: path.relative(config.productDir, state.cachePath),
464
+ refreshedAt: sourceMetadata.refreshedAt || null,
465
+ },
466
+ repo: state.repoState ? summarizeRepoStateForMetadata(state.repoState) : null,
414
467
  };
415
468
  }
416
469
 
@@ -6,6 +6,29 @@ export interface LoadDotenvFilesOptions {
6
6
  override?: boolean;
7
7
  }
8
8
 
9
+ export interface PostgresConnectionEnvFallback {
10
+ database?: string;
11
+ host?: string;
12
+ password?: string;
13
+ port?: number | string;
14
+ ssl?: boolean;
15
+ username?: string;
16
+ }
17
+
18
+ export interface PostgresConnectionEnvOptions {
19
+ env?: NodeJS.ProcessEnv;
20
+ fallback?: PostgresConnectionEnvFallback;
21
+ }
22
+
23
+ export interface PostgresConnectionEnvValue {
24
+ database: string;
25
+ host: string;
26
+ password: string;
27
+ port: number;
28
+ ssl: boolean;
29
+ username: string;
30
+ }
31
+
9
32
  export declare function isManagedRuntime(env?: NodeJS.ProcessEnv): boolean;
10
33
  export declare function shouldLoadDotenv(env?: NodeJS.ProcessEnv): boolean;
11
34
  export declare function loadDotenvFiles(options?: LoadDotenvFilesOptions): {
@@ -15,3 +38,7 @@ export declare function assertLocalDatabaseUrl(
15
38
  env?: NodeJS.ProcessEnv,
16
39
  consumer?: string
17
40
  ): void;
41
+ export declare function readPostgresConnectionFromEnv(
42
+ prefix: string,
43
+ options?: PostgresConnectionEnvOptions
44
+ ): PostgresConnectionEnvValue;
package/lib/env/index.mjs CHANGED
@@ -63,3 +63,57 @@ export function assertLocalDatabaseUrl(env = process.env, consumer = "This comma
63
63
  );
64
64
  }
65
65
  }
66
+
67
+ export function readPostgresConnectionFromEnv(prefix, options = {}) {
68
+ const env = options.env || process.env;
69
+ const normalizedPrefix = String(prefix || "").trim();
70
+ if (!normalizedPrefix) {
71
+ throw new Error("readPostgresConnectionFromEnv requires an environment variable prefix");
72
+ }
73
+
74
+ const fallback = options.fallback || {};
75
+ return {
76
+ host: readEnvValue(env, `${normalizedPrefix}_HOST`, fallback.host),
77
+ port: readEnvPort(env, `${normalizedPrefix}_PORT`, fallback.port),
78
+ database: readEnvValue(env, `${normalizedPrefix}_NAME`, fallback.database),
79
+ username: readEnvValue(env, `${normalizedPrefix}_USER`, fallback.username),
80
+ password: readEnvValue(env, `${normalizedPrefix}_PASSWORD`, fallback.password),
81
+ ssl: readEnvBoolean(env, `${normalizedPrefix}_SSL`, fallback.ssl ?? false),
82
+ };
83
+ }
84
+
85
+ function readEnvValue(env, name, fallback) {
86
+ const value = env?.[name]?.trim();
87
+ if (value) return value;
88
+ if (fallback != null && String(fallback).trim()) return String(fallback).trim();
89
+ throw new Error(`${name} environment variable is required`);
90
+ }
91
+
92
+ function readEnvPort(env, name, fallback) {
93
+ const raw = env?.[name]?.trim();
94
+ const value = raw || (fallback == null ? "" : String(fallback));
95
+ const parsed = Number.parseInt(value, 10);
96
+ if (!Number.isInteger(parsed) || parsed <= 0) {
97
+ throw new Error(`${name} must be a positive integer`);
98
+ }
99
+ return parsed;
100
+ }
101
+
102
+ function readEnvBoolean(env, name, fallback) {
103
+ const value = env?.[name];
104
+ if (!value) return Boolean(fallback);
105
+ switch (value.trim().toLowerCase()) {
106
+ case "1":
107
+ case "true":
108
+ case "yes":
109
+ case "on":
110
+ return true;
111
+ case "0":
112
+ case "false":
113
+ case "no":
114
+ case "off":
115
+ return false;
116
+ default:
117
+ return Boolean(fallback);
118
+ }
119
+ }
@@ -432,11 +432,23 @@ export declare function expectResponse(
432
432
  export declare function expectValue<T>(
433
433
  value: T,
434
434
  predicate: (value: T) => boolean,
435
- label: string
435
+ label: string,
436
+ options?: {
437
+ actual?: ((value: T) => unknown) | unknown;
438
+ describeFailure?: ((value: T) => string) | string;
439
+ expected?: unknown;
440
+ kind?: string;
441
+ }
436
442
  ): boolean;
437
443
  export declare function expectCondition(
438
444
  predicate: () => boolean,
439
- label: string
445
+ label: string,
446
+ options?: {
447
+ actual?: (() => unknown) | unknown;
448
+ describeFailure?: (() => string) | string;
449
+ expected?: unknown;
450
+ kind?: string;
451
+ }
440
452
  ): boolean;
441
453
  export declare function expectRowCount<T>(
442
454
  rows: T[],
@@ -452,7 +464,7 @@ export declare function expectNoRows<T>(
452
464
  label?: string | null
453
465
  ): boolean;
454
466
  export declare function expectField<T extends Record<string, unknown>>(
455
- row: T,
467
+ row: T | T[],
456
468
  field: keyof T | string,
457
469
  predicateOrExpected: unknown | ((value: unknown) => boolean),
458
470
  label?: string | null
@@ -470,7 +482,7 @@ export declare function expectType(
470
482
  export declare function captureError(fn: () => unknown): unknown | null;
471
483
  export declare function expectError(
472
484
  errorOrFn: unknown | (() => unknown) | null,
473
- predicate?: ((error: unknown) => boolean) | null,
485
+ predicate?: ((error: unknown) => boolean) | string | null,
474
486
  label?: string | null
475
487
  ): boolean;
476
488
 
@@ -3,6 +3,15 @@ import {
3
3
  extractErrorMessageFromBody,
4
4
  hasStandardErrorShape,
5
5
  } from "../shared/error-body.mjs";
6
+ import {
7
+ buildValueAssertionDetail,
8
+ formatAssertionValue,
9
+ normalizeErrorValue,
10
+ resolveActual,
11
+ resolveConditionActual,
12
+ resolveConditionFailureMessage,
13
+ resolveFailureMessage,
14
+ } from "../shared/assertion-details.mjs";
6
15
  import { safeJson, summarizeHttpTrace, toBodyPreview } from "./http.js";
7
16
 
8
17
  export function expectStatus(response, expected, label = null) {
@@ -140,16 +149,34 @@ export function expectResponse(response, predicate, label) {
140
149
  });
141
150
  }
142
151
 
143
- export function expectValue(value, predicate, label) {
144
- return check(value, {
145
- [normalizeLabel(label, "value matches expectation")]: predicate,
146
- });
152
+ export function expectValue(value, predicate, label, options = {}) {
153
+ const title = normalizeLabel(label, "value matches expectation");
154
+ return evaluateCheck(value, title, predicate, () =>
155
+ buildValueAssertionDetail({
156
+ kind: options.kind || "value-assertion",
157
+ title,
158
+ actual: resolveActual(value, options.actual),
159
+ expected: options.expected,
160
+ message: resolveFailureMessage(value, title, options.describeFailure),
161
+ })
162
+ );
147
163
  }
148
164
 
149
- export function expectCondition(predicate, label) {
150
- return check(null, {
151
- [normalizeLabel(label, "condition holds")]: () => Boolean(predicate()),
152
- });
165
+ export function expectCondition(predicate, label, options = {}) {
166
+ const title = normalizeLabel(label, "condition holds");
167
+ return evaluateCheck(
168
+ null,
169
+ title,
170
+ () => Boolean(predicate()),
171
+ () =>
172
+ buildValueAssertionDetail({
173
+ kind: options.kind || "condition-assertion",
174
+ title,
175
+ actual: resolveConditionActual(options.actual),
176
+ expected: options.expected,
177
+ message: resolveConditionFailureMessage(title, options.describeFailure),
178
+ })
179
+ );
153
180
  }
154
181
 
155
182
  export function expectRowCount(rows, expectedCount, label = null) {
@@ -160,7 +187,14 @@ export function expectRowCount(rows, expectedCount, label = null) {
160
187
  return expectValue(
161
188
  rows,
162
189
  (value) => Array.isArray(value) && value.length === expected,
163
- normalizeLabel(label, `row count is ${expected}`)
190
+ normalizeLabel(label, `row count is ${expected}`),
191
+ {
192
+ actual: (value) => (Array.isArray(value) ? value.length : undefined),
193
+ describeFailure: (value) =>
194
+ `expected ${expected} row(s), got ${Array.isArray(value) ? value.length : "non-array value"}`,
195
+ expected,
196
+ kind: "row-count-assertion",
197
+ }
164
198
  );
165
199
  }
166
200
 
@@ -173,12 +207,23 @@ export function expectNoRows(rows, label = "query returns no rows") {
173
207
  return expectRowCount(rows, 0, label);
174
208
  }
175
209
 
176
- export function expectField(row, field, predicateOrExpected, label = null) {
210
+ export function expectField(rowOrRows, field, predicateOrExpected, label = null) {
177
211
  const fieldName = String(field || "");
212
+ const row = Array.isArray(rowOrRows) ? rowOrRows[0] : rowOrRows;
213
+ const expected = typeof predicateOrExpected === "function" ? undefined : predicateOrExpected;
178
214
  return expectValue(
179
215
  row?.[fieldName],
180
216
  normalizeFieldPredicate(predicateOrExpected),
181
- normalizeLabel(label, `${fieldName || "field"} matches expectation`)
217
+ normalizeLabel(label, `${fieldName || "field"} matches expectation`),
218
+ {
219
+ actual: row?.[fieldName],
220
+ describeFailure: () =>
221
+ Array.isArray(rowOrRows) && rowOrRows.length === 0
222
+ ? `expected ${fieldName || "field"}=${formatAssertionValue(expected)}, but query returned 0 rows`
223
+ : `${fieldName || "field"} expected ${formatAssertionValue(expected)}, got ${formatAssertionValue(row?.[fieldName])}`,
224
+ expected,
225
+ kind: "field-assertion",
226
+ }
182
227
  );
183
228
  }
184
229
 
@@ -198,7 +243,13 @@ export function expectType(value, typeName, label = null) {
198
243
  return expectValue(
199
244
  value,
200
245
  (actual) => actualType(actual) === expected,
201
- normalizeLabel(label, `type is ${expected}`)
246
+ normalizeLabel(label, `type is ${expected}`),
247
+ {
248
+ actual: (actual) => actualType(actual),
249
+ describeFailure: (actual) => `expected type ${expected}, got ${actualType(actual)}`,
250
+ expected,
251
+ kind: "type-assertion",
252
+ }
202
253
  );
203
254
  }
204
255
 
@@ -213,13 +264,21 @@ export function captureError(fn) {
213
264
 
214
265
  export function expectError(errorOrFn, predicate = null, label = null) {
215
266
  const error = typeof errorOrFn === "function" ? captureError(errorOrFn) : errorOrFn;
267
+ const predicateFn = typeof predicate === "function" ? predicate : null;
268
+ const title = typeof predicate === "string" && label == null ? predicate : label;
216
269
  return expectValue(
217
270
  error,
218
271
  (value) => {
219
272
  if (!value) return false;
220
- return typeof predicate === "function" ? Boolean(predicate(value)) : true;
273
+ return predicateFn ? Boolean(predicateFn(value)) : true;
221
274
  },
222
- normalizeLabel(label, "error is captured")
275
+ normalizeLabel(title, "error is captured"),
276
+ {
277
+ actual: normalizeErrorValue(error),
278
+ describeFailure: () => "expected operation to throw",
279
+ expected: "error",
280
+ kind: "error-assertion",
281
+ }
223
282
  );
224
283
  }
225
284
 
@@ -0,0 +1,98 @@
1
+ export function buildValueAssertionDetail({ actual, expected, kind, message, title }) {
2
+ const location = captureCallsite();
3
+ return {
4
+ kind,
5
+ key: location ? `${location.path}:${location.line}:${location.column}` : title,
6
+ title,
7
+ message,
8
+ expected: normalizeAssertionValue(expected),
9
+ actual: normalizeAssertionValue(actual),
10
+ location,
11
+ };
12
+ }
13
+
14
+ export function resolveActual(value, actual) {
15
+ if (typeof actual === "function") return actual(value);
16
+ if (actual !== undefined) return actual;
17
+ return value;
18
+ }
19
+
20
+ export function resolveConditionActual(actual) {
21
+ if (typeof actual === "function") return actual();
22
+ return actual;
23
+ }
24
+
25
+ export function resolveFailureMessage(value, label, describeFailure) {
26
+ if (typeof describeFailure === "function") return describeFailure(value);
27
+ if (typeof describeFailure === "string" && describeFailure.trim().length > 0) {
28
+ return describeFailure;
29
+ }
30
+ return label;
31
+ }
32
+
33
+ export function resolveConditionFailureMessage(label, describeFailure) {
34
+ if (typeof describeFailure === "function") return describeFailure();
35
+ if (typeof describeFailure === "string" && describeFailure.trim().length > 0) {
36
+ return describeFailure;
37
+ }
38
+ return label;
39
+ }
40
+
41
+ export function normalizeAssertionValue(value) {
42
+ if (
43
+ value === null ||
44
+ value === undefined ||
45
+ typeof value === "boolean" ||
46
+ typeof value === "number" ||
47
+ typeof value === "string"
48
+ ) {
49
+ return value;
50
+ }
51
+ if (typeof value === "bigint") return value.toString();
52
+ try {
53
+ return JSON.parse(JSON.stringify(value));
54
+ } catch {
55
+ return String(value);
56
+ }
57
+ }
58
+
59
+ export function formatAssertionValue(value) {
60
+ if (typeof value === "string") return JSON.stringify(value);
61
+ if (value === undefined) return "undefined";
62
+ if (typeof value === "bigint") return value.toString();
63
+ try {
64
+ return JSON.stringify(value);
65
+ } catch {
66
+ return String(value);
67
+ }
68
+ }
69
+
70
+ export function normalizeErrorValue(error) {
71
+ if (!error) return null;
72
+ if (error instanceof Error) return error.message;
73
+ return String(error);
74
+ }
75
+
76
+ function captureCallsite() {
77
+ const stack = new Error().stack;
78
+ if (!stack) return null;
79
+
80
+ for (const line of stack.split("\n").slice(1)) {
81
+ const match = line.match(/(file:\/\/[^\s)]+|\/[^\s):]+):(\d+):(\d+)/);
82
+ if (!match) continue;
83
+ const [rawPath, rawLine, rawColumn] = match.slice(1);
84
+ if (!rawPath || !rawLine || !rawColumn) continue;
85
+ const stackPath = rawPath.startsWith("file://") ? rawPath.slice("file://".length) : rawPath;
86
+ if (stackPath.endsWith("/runtime-src/shared/assertion-details.mjs")) continue;
87
+ if (stackPath.endsWith("/runtime-src/k6/http-assertions.js")) continue;
88
+ if (stackPath.endsWith("/runtime-src/k6/checks.js")) continue;
89
+ if (stackPath.endsWith("/runtime/index.mjs")) continue;
90
+ return {
91
+ path: stackPath,
92
+ line: Number(rawLine),
93
+ column: Number(rawColumn),
94
+ };
95
+ }
96
+
97
+ return null;
98
+ }
package/lib/ui/index.d.ts CHANGED
@@ -105,6 +105,19 @@ export declare function waitForAnimationFrames(
105
105
  page: import("@playwright/test").Page,
106
106
  frames?: number
107
107
  ): Promise<void>;
108
+ export declare function waitForNetworkIdle(
109
+ page: import("@playwright/test").Page,
110
+ options?: { frames?: number; timeout?: number }
111
+ ): Promise<void>;
112
+ export declare function waitForElementStable(
113
+ page: import("@playwright/test").Page,
114
+ selector: string,
115
+ options?: { frames?: number; timeout?: number }
116
+ ): Promise<void>;
117
+ export declare function waitForImagesLoaded(
118
+ page: import("@playwright/test").Page,
119
+ containerSelector?: string | null
120
+ ): Promise<void>;
108
121
  export declare function readUiConfig(env?: NodeJS.ProcessEnv): unknown;
109
122
  export declare function provisionUiIdentity(
110
123
  page: import("@playwright/test").Page,
package/lib/ui/index.mjs CHANGED
@@ -10,6 +10,9 @@ export {
10
10
  resolveBackendBaseUrl,
11
11
  resolveFrontendBaseUrl,
12
12
  waitForAnimationFrames,
13
+ waitForElementStable,
14
+ waitForImagesLoaded,
15
+ waitForNetworkIdle,
13
16
  waitForUiSettled,
14
17
  } from "./sandbox.mjs";
15
18
  export {
@@ -220,7 +220,7 @@ export async function waitForUiSettled(page, options = {}) {
220
220
  const timeout = options.timeout ?? 5_000;
221
221
  await page.waitForLoadState("domcontentloaded", { timeout });
222
222
  await waitForAnimationFrames(page, options.frames ?? 2);
223
- await page.waitForLoadState("networkidle", { timeout }).catch(() => {});
223
+ await waitForNetworkIdle(page, { frames: options.frames ?? 2, timeout });
224
224
  }
225
225
 
226
226
  export async function waitForAnimationFrames(page, frames = 2) {
@@ -243,6 +243,52 @@ export async function waitForAnimationFrames(page, frames = 2) {
243
243
  );
244
244
  }
245
245
 
246
+ export async function waitForNetworkIdle(page, options = {}) {
247
+ const timeout = options.timeout ?? 2_000;
248
+ try {
249
+ await page.waitForLoadState("networkidle", { timeout });
250
+ } catch {
251
+ await page.waitForLoadState("load", { timeout }).catch(() => {});
252
+ await waitForAnimationFrames(page, options.frames ?? 2);
253
+ }
254
+ }
255
+
256
+ export async function waitForElementStable(page, selector, options = {}) {
257
+ const stableFrames = Math.max(1, Number(options.frames) || 2);
258
+ const element = page.locator(selector);
259
+ await element.waitFor({ state: "visible", timeout: options.timeout });
260
+ await element.evaluate(async (node, requiredStableFrames) => {
261
+ let stable = 0;
262
+ let previous = JSON.stringify(node.getBoundingClientRect().toJSON());
263
+ while (stable < requiredStableFrames) {
264
+ await new Promise((resolve) => requestAnimationFrame(() => resolve()));
265
+ const current = JSON.stringify(node.getBoundingClientRect().toJSON());
266
+ if (current === previous) {
267
+ stable += 1;
268
+ } else {
269
+ stable = 0;
270
+ }
271
+ previous = current;
272
+ }
273
+ }, stableFrames);
274
+ }
275
+
276
+ export async function waitForImagesLoaded(page, containerSelector = null) {
277
+ const selector = containerSelector ? `${containerSelector} img` : "img";
278
+ const images = page.locator(selector);
279
+ const count = await images.count();
280
+
281
+ for (let index = 0; index < count; index += 1) {
282
+ await images.nth(index).evaluate((element) => {
283
+ if (element.complete) return undefined;
284
+ return new Promise((resolve) => {
285
+ element.addEventListener("load", resolve, { once: true });
286
+ element.addEventListener("error", resolve, { once: true });
287
+ });
288
+ });
289
+ }
290
+ }
291
+
246
292
  function resolveBaseUrl(value) {
247
293
  const normalized = String(value || "").trim();
248
294
  if (!normalized) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elench/next-analysis",
3
- "version": "0.1.133",
3
+ "version": "0.1.135",
4
4
  "description": "SWC-backed Next.js source analysis primitives for Erench tools",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elench/testkit-bridge",
3
- "version": "0.1.133",
3
+ "version": "0.1.135",
4
4
  "description": "Browser bridge helpers for testkit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "typecheck": "tsc -p tsconfig.json --noEmit"
23
23
  },
24
24
  "dependencies": {
25
- "@elench/testkit-protocol": "0.1.133"
25
+ "@elench/testkit-protocol": "0.1.135"
26
26
  },
27
27
  "private": false
28
28
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elench/testkit-protocol",
3
- "version": "0.1.133",
3
+ "version": "0.1.135",
4
4
  "description": "Shared browser protocol for testkit bridge and extension consumers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elench/ts-analysis",
3
- "version": "0.1.133",
3
+ "version": "0.1.135",
4
4
  "description": "TypeScript compiler-backed source analysis primitives for Erench tools",
5
5
  "type": "module",
6
6
  "exports": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elench/testkit",
3
- "version": "0.1.133",
3
+ "version": "0.1.135",
4
4
  "description": "Assistant-first CLI for running, inspecting, and debugging local testkit suites",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -95,10 +95,10 @@
95
95
  },
96
96
  "dependencies": {
97
97
  "@babel/code-frame": "^7.29.0",
98
- "@elench/next-analysis": "0.1.133",
99
- "@elench/testkit-bridge": "0.1.133",
100
- "@elench/testkit-protocol": "0.1.133",
101
- "@elench/ts-analysis": "0.1.133",
98
+ "@elench/next-analysis": "0.1.135",
99
+ "@elench/testkit-bridge": "0.1.135",
100
+ "@elench/testkit-protocol": "0.1.135",
101
+ "@elench/ts-analysis": "0.1.135",
102
102
  "@oclif/core": "^4.10.6",
103
103
  "@playwright/test": "^1.52.0",
104
104
  "esbuild": "^0.25.11",
@@ -1,188 +0,0 @@
1
- export declare const TESTKIT_BROWSER_PROTOCOL_VERSION = 1;
2
- export declare const TESTKIT_COVERAGE_GRAPH_VERSION = 1;
3
- export type BrowserTargetKind = "testId" | "role" | "text" | "css" | "xpath" | "component";
4
- export type BrowserConfidence = "low" | "medium" | "high";
5
- export type BrowserFailureState = "failing" | "healthy" | "unavailable";
6
- export type BrowserCoverageState = "covered" | "missing" | "unavailable";
7
- export type BridgeSurfaceImportance = "critical" | "high" | "medium" | "low";
8
- export type BridgeCoverageSupportKind = "direct" | "indirect" | "mixed";
9
- export type CoverageNodeKind = "page_view" | "ui_surface" | "ui_action" | "client_request" | "api_route" | "server_action" | "server_capability" | "data_capability" | "test_file";
10
- export type CoverageEdgeKind = "contains" | "renders" | "triggers" | "requests" | "handles" | "delegates_to" | "covers";
11
- export type CoverageEvidenceSource = "convention" | "static" | "runtime";
12
- export type CoverageGraphDiagnosticLevel = "info" | "warn";
13
- export interface BrowserTarget {
14
- kind: BrowserTargetKind;
15
- value: string;
16
- label?: string;
17
- confidence?: BrowserConfidence;
18
- }
19
- export interface BrowserMetadata {
20
- label?: string;
21
- origins?: string[];
22
- routes?: string[];
23
- targets?: BrowserTarget[];
24
- }
25
- export interface BrowserMetadataDocument {
26
- schemaVersion: number;
27
- browser: BrowserMetadata;
28
- }
29
- export interface CoverageGraphNode {
30
- id: string;
31
- kind: CoverageNodeKind;
32
- service: string;
33
- label: string;
34
- filePath?: string;
35
- route?: string;
36
- method?: string;
37
- path?: string;
38
- target?: BrowserTarget | null;
39
- metadata?: Record<string, string | number | boolean | null>;
40
- }
41
- export interface CoverageGraphEdge {
42
- id: string;
43
- kind: CoverageEdgeKind;
44
- from: string;
45
- to: string;
46
- confidence?: BrowserConfidence;
47
- metadata?: Record<string, string | number | boolean | null>;
48
- }
49
- export interface CoverageEvidenceDetails {
50
- requestPaths?: string[];
51
- route?: string;
52
- targets?: BrowserTarget[];
53
- }
54
- export interface CoverageEvidence {
55
- id: string;
56
- source: CoverageEvidenceSource;
57
- confidence?: BrowserConfidence;
58
- service: string;
59
- suiteName: string;
60
- type: string;
61
- testFilePath: string;
62
- coveredNodeIds: string[];
63
- details?: CoverageEvidenceDetails;
64
- }
65
- export interface CoverageGraphDiagnostic {
66
- level: CoverageGraphDiagnosticLevel;
67
- code: string;
68
- filePath: string;
69
- service: string;
70
- message: string;
71
- }
72
- export interface CoverageGraph {
73
- schemaVersion: number;
74
- nodes: CoverageGraphNode[];
75
- edges: CoverageGraphEdge[];
76
- evidence: CoverageEvidence[];
77
- diagnostics: CoverageGraphDiagnostic[];
78
- }
79
- export interface BridgeProductRef {
80
- name: string;
81
- directory: string;
82
- }
83
- export interface BridgeServiceRef {
84
- name: string;
85
- baseUrl: string;
86
- origin: string;
87
- }
88
- export interface BrowserMatchResponse {
89
- protocolVersion: number;
90
- url: string;
91
- origin: string;
92
- route: string;
93
- matched: boolean;
94
- product: BridgeProductRef;
95
- service: BridgeServiceRef | null;
96
- }
97
- export interface BridgeRunSummary {
98
- artifactAvailable: boolean;
99
- generatedAt: string | null;
100
- status: string | null;
101
- }
102
- export interface BridgeSupportingTestRef {
103
- service: string;
104
- suite: string;
105
- type: string;
106
- filePath: string;
107
- label: string;
108
- status?: "passed" | "failed" | "skipped" | "not_run";
109
- error?: string | null;
110
- }
111
- export interface BridgeCoverageViaNodeRef {
112
- id: string;
113
- kind: CoverageNodeKind;
114
- label: string;
115
- route?: string;
116
- method?: string;
117
- path?: string;
118
- }
119
- export interface FailureOverlayEntry {
120
- id: string;
121
- kind: CoverageNodeKind;
122
- label: string;
123
- service: string;
124
- route?: string | null;
125
- targets: BrowserTarget[];
126
- failedTests: BridgeSupportingTestRef[];
127
- viaNodes: BridgeCoverageViaNodeRef[];
128
- importance?: BridgeSurfaceImportance;
129
- surfaceKind?: string | null;
130
- reason?: string | null;
131
- }
132
- export interface CoverageOverlayEntry {
133
- id: string;
134
- kind: CoverageNodeKind;
135
- label: string;
136
- service: string;
137
- route?: string | null;
138
- targets: BrowserTarget[];
139
- supportingTests: BridgeSupportingTestRef[];
140
- viaNodes: BridgeCoverageViaNodeRef[];
141
- confidence: BrowserConfidence;
142
- importance?: BridgeSurfaceImportance;
143
- surfaceKind?: string | null;
144
- supportKind?: BridgeCoverageSupportKind;
145
- reason?: string | null;
146
- }
147
- export interface PageOverlayResponse {
148
- protocolVersion: number;
149
- page: {
150
- url: string;
151
- origin: string;
152
- route: string;
153
- };
154
- match: BrowserMatchResponse;
155
- run: BridgeRunSummary;
156
- summary: {
157
- failureState: BrowserFailureState;
158
- coverageState: BrowserCoverageState;
159
- relatedFailureCount: number;
160
- relatedCoverageCount: number;
161
- coverageBreakdown?: {
162
- direct: number;
163
- indirect: number;
164
- mixed: number;
165
- };
166
- };
167
- failures: FailureOverlayEntry[];
168
- coverage: CoverageOverlayEntry[];
169
- }
170
- export interface BridgeErrorResponse {
171
- protocolVersion: number;
172
- error: {
173
- code: string;
174
- message: string;
175
- };
176
- }
177
- export declare function normalizeBrowserTarget(value: unknown): BrowserTarget | null;
178
- export declare function normalizeBrowserMetadata(value: unknown): BrowserMetadata | null;
179
- export declare function normalizeBrowserMetadataDocument(value: unknown): BrowserMetadataDocument | null;
180
- export declare function normalizeCoverageGraphNode(value: unknown): CoverageGraphNode | null;
181
- export declare function normalizeCoverageGraphEdge(value: unknown): CoverageGraphEdge | null;
182
- export declare function normalizeCoverageEvidence(value: unknown): CoverageEvidence | null;
183
- export declare function normalizeCoverageGraphDiagnostic(value: unknown): CoverageGraphDiagnostic | null;
184
- export declare function normalizeCoverageGraph(value: unknown): CoverageGraph | null;
185
- export declare function isPageOverlayResponse(value: unknown): value is PageOverlayResponse;
186
- export declare function normalizePageOverlayResponse(value: unknown): PageOverlayResponse | null;
187
- export declare function createBridgeErrorResponse(code: string, message: string): BridgeErrorResponse;
188
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC;AAC3F,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AACzE,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAC7E,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAExE,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,WAAW,GACX,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,WAAW,CAAC;AAEhB,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,cAAc,GACd,QAAQ,CAAC;AAEb,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AACzE,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,MAAM,CAAC;A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AE,MAAM,CAAC;KACjB,CAAC;CACH;AA+BD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAc3E;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAkB/E;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAa/F;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI,CA0BnF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI,CAkBnF;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAmCjF;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAW/F;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CA6B3E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAElF;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAYvF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAQ5F"}
@@ -1,293 +0,0 @@
1
- export const TESTKIT_BROWSER_PROTOCOL_VERSION = 1;
2
- export const TESTKIT_COVERAGE_GRAPH_VERSION = 1;
3
- const TARGET_KINDS = new Set(["testId", "role", "text", "css", "xpath", "component"]);
4
- const CONFIDENCE_LEVELS = new Set(["low", "medium", "high"]);
5
- const FAILURE_STATES = new Set(["failing", "healthy", "unavailable"]);
6
- const COVERAGE_STATES = new Set(["covered", "missing", "unavailable"]);
7
- const NODE_KINDS = new Set([
8
- "page_view",
9
- "ui_surface",
10
- "ui_action",
11
- "client_request",
12
- "api_route",
13
- "server_action",
14
- "server_capability",
15
- "data_capability",
16
- "test_file",
17
- ]);
18
- const EDGE_KINDS = new Set([
19
- "contains",
20
- "renders",
21
- "triggers",
22
- "requests",
23
- "handles",
24
- "delegates_to",
25
- "covers",
26
- ]);
27
- const EVIDENCE_SOURCES = new Set(["convention", "static", "runtime"]);
28
- const DIAGNOSTIC_LEVELS = new Set(["info", "warn"]);
29
- export function normalizeBrowserTarget(value) {
30
- if (!value || typeof value !== "object" || Array.isArray(value))
31
- return null;
32
- const record = value;
33
- const kind = normalizeOptionalString(record.kind);
34
- const targetValue = normalizeOptionalString(record.value);
35
- if (!kind || !isSetValue(TARGET_KINDS, kind) || !targetValue)
36
- return null;
37
- const label = normalizeOptionalString(record.label);
38
- const confidence = normalizeOptionalString(record.confidence);
39
- return {
40
- kind,
41
- value: targetValue,
42
- ...(label ? { label } : {}),
43
- ...(confidence && isSetValue(CONFIDENCE_LEVELS, confidence) ? { confidence } : {}),
44
- };
45
- }
46
- export function normalizeBrowserMetadata(value) {
47
- if (!value || typeof value !== "object" || Array.isArray(value))
48
- return null;
49
- const record = value;
50
- const label = normalizeOptionalString(record.label);
51
- const origins = normalizeStringArray(record.origins);
52
- const routes = normalizeStringArray(record.routes);
53
- const targets = Array.isArray(record.targets)
54
- ? record.targets.map((entry) => normalizeBrowserTarget(entry)).filter((entry) => Boolean(entry))
55
- : [];
56
- if (!label && origins.length === 0 && routes.length === 0 && targets.length === 0) {
57
- return null;
58
- }
59
- return {
60
- ...(label ? { label } : {}),
61
- ...(origins.length > 0 ? { origins } : {}),
62
- ...(routes.length > 0 ? { routes } : {}),
63
- ...(targets.length > 0 ? { targets } : {}),
64
- };
65
- }
66
- export function normalizeBrowserMetadataDocument(value) {
67
- if (!value || typeof value !== "object" || Array.isArray(value))
68
- return null;
69
- const record = value;
70
- const schemaVersion = Number.isInteger(record.schemaVersion) && Number(record.schemaVersion) > 0
71
- ? Number(record.schemaVersion)
72
- : TESTKIT_BROWSER_PROTOCOL_VERSION;
73
- const browser = normalizeBrowserMetadata(record.browser);
74
- if (!browser)
75
- return null;
76
- return {
77
- schemaVersion,
78
- browser,
79
- };
80
- }
81
- export function normalizeCoverageGraphNode(value) {
82
- if (!value || typeof value !== "object" || Array.isArray(value))
83
- return null;
84
- const record = value;
85
- const id = normalizeOptionalString(record.id);
86
- const kind = normalizeOptionalString(record.kind);
87
- const service = normalizeOptionalString(record.service);
88
- const label = normalizeOptionalString(record.label);
89
- if (!id || !kind || !isSetValue(NODE_KINDS, kind) || !service || !label)
90
- return null;
91
- const filePath = normalizeOptionalString(record.filePath);
92
- const route = normalizeOptionalString(record.route);
93
- const method = normalizeOptionalString(record.method);
94
- const path = normalizeOptionalString(record.path);
95
- const target = normalizeBrowserTarget(record.target);
96
- const metadata = normalizeMetadataRecord(record.metadata);
97
- return {
98
- id,
99
- kind,
100
- service,
101
- label,
102
- ...(filePath ? { filePath } : {}),
103
- ...(route ? { route } : {}),
104
- ...(method ? { method } : {}),
105
- ...(path ? { path } : {}),
106
- ...(target ? { target } : {}),
107
- ...(metadata ? { metadata } : {}),
108
- };
109
- }
110
- export function normalizeCoverageGraphEdge(value) {
111
- if (!value || typeof value !== "object" || Array.isArray(value))
112
- return null;
113
- const record = value;
114
- const id = normalizeOptionalString(record.id);
115
- const kind = normalizeOptionalString(record.kind);
116
- const from = normalizeOptionalString(record.from);
117
- const to = normalizeOptionalString(record.to);
118
- if (!id || !kind || !isSetValue(EDGE_KINDS, kind) || !from || !to)
119
- return null;
120
- const confidence = normalizeOptionalString(record.confidence);
121
- const metadata = normalizeMetadataRecord(record.metadata);
122
- return {
123
- id,
124
- kind,
125
- from,
126
- to,
127
- ...(confidence && isSetValue(CONFIDENCE_LEVELS, confidence) ? { confidence } : {}),
128
- ...(metadata ? { metadata } : {}),
129
- };
130
- }
131
- export function normalizeCoverageEvidence(value) {
132
- if (!value || typeof value !== "object" || Array.isArray(value))
133
- return null;
134
- const record = value;
135
- const id = normalizeOptionalString(record.id);
136
- const source = normalizeOptionalString(record.source);
137
- const service = normalizeOptionalString(record.service);
138
- const suiteName = normalizeOptionalString(record.suiteName);
139
- const type = normalizeOptionalString(record.type) || normalizeOptionalString(record.selectionType);
140
- const testFilePath = normalizeOptionalString(record.testFilePath);
141
- const coveredNodeIds = normalizeStringArray(record.coveredNodeIds);
142
- if (!id ||
143
- !source ||
144
- !isSetValue(EVIDENCE_SOURCES, source) ||
145
- !service ||
146
- !suiteName ||
147
- !type ||
148
- !testFilePath ||
149
- coveredNodeIds.length === 0) {
150
- return null;
151
- }
152
- const confidence = normalizeOptionalString(record.confidence);
153
- const details = normalizeEvidenceDetails(record.details);
154
- return {
155
- id,
156
- source,
157
- service,
158
- suiteName,
159
- type,
160
- testFilePath,
161
- coveredNodeIds,
162
- ...(confidence && isSetValue(CONFIDENCE_LEVELS, confidence) ? { confidence } : {}),
163
- ...(details ? { details } : {}),
164
- };
165
- }
166
- export function normalizeCoverageGraphDiagnostic(value) {
167
- if (!value || typeof value !== "object" || Array.isArray(value))
168
- return null;
169
- const record = value;
170
- const level = normalizeOptionalString(record.level);
171
- const code = normalizeOptionalString(record.code);
172
- const filePath = normalizeOptionalString(record.filePath);
173
- const service = normalizeOptionalString(record.service);
174
- const message = normalizeOptionalString(record.message);
175
- if (!level || !code || !filePath || !service || !message)
176
- return null;
177
- if (!isSetValue(DIAGNOSTIC_LEVELS, level))
178
- return null;
179
- return { level, code, filePath, service, message };
180
- }
181
- export function normalizeCoverageGraph(value) {
182
- if (!value || typeof value !== "object" || Array.isArray(value))
183
- return null;
184
- const record = value;
185
- const schemaVersion = Number.isInteger(record.schemaVersion) && Number(record.schemaVersion) > 0
186
- ? Number(record.schemaVersion)
187
- : TESTKIT_COVERAGE_GRAPH_VERSION;
188
- const nodes = Array.isArray(record.nodes)
189
- ? record.nodes.map((entry) => normalizeCoverageGraphNode(entry)).filter((entry) => Boolean(entry))
190
- : [];
191
- const edges = Array.isArray(record.edges)
192
- ? record.edges.map((entry) => normalizeCoverageGraphEdge(entry)).filter((entry) => Boolean(entry))
193
- : [];
194
- const evidence = Array.isArray(record.evidence)
195
- ? record.evidence.map((entry) => normalizeCoverageEvidence(entry)).filter((entry) => Boolean(entry))
196
- : [];
197
- const diagnostics = Array.isArray(record.diagnostics)
198
- ? record.diagnostics
199
- .map((entry) => normalizeCoverageGraphDiagnostic(entry))
200
- .filter((entry) => Boolean(entry))
201
- : [];
202
- if (nodes.length === 0)
203
- return null;
204
- return {
205
- schemaVersion,
206
- nodes,
207
- edges,
208
- evidence,
209
- diagnostics,
210
- };
211
- }
212
- export function isPageOverlayResponse(value) {
213
- return Boolean(normalizePageOverlayResponse(value));
214
- }
215
- export function normalizePageOverlayResponse(value) {
216
- if (!value || typeof value !== "object" || Array.isArray(value))
217
- return null;
218
- const record = value;
219
- if (record.protocolVersion !== TESTKIT_BROWSER_PROTOCOL_VERSION)
220
- return null;
221
- if (!record.page || typeof record.page !== "object")
222
- return null;
223
- if (!record.match || typeof record.match !== "object")
224
- return null;
225
- if (!record.summary || typeof record.summary !== "object")
226
- return null;
227
- if (!Array.isArray(record.coverage) || !Array.isArray(record.failures))
228
- return null;
229
- const summary = record.summary;
230
- if (!isSetValue(FAILURE_STATES, summary.failureState))
231
- return null;
232
- if (!isSetValue(COVERAGE_STATES, summary.coverageState))
233
- return null;
234
- return record;
235
- }
236
- export function createBridgeErrorResponse(code, message) {
237
- return {
238
- protocolVersion: TESTKIT_BROWSER_PROTOCOL_VERSION,
239
- error: {
240
- code,
241
- message,
242
- },
243
- };
244
- }
245
- function normalizeEvidenceDetails(value) {
246
- if (!value || typeof value !== "object" || Array.isArray(value))
247
- return null;
248
- const record = value;
249
- const requestPaths = normalizeStringArray(record.requestPaths);
250
- const route = normalizeOptionalString(record.route);
251
- const targets = Array.isArray(record.targets)
252
- ? record.targets.map((entry) => normalizeBrowserTarget(entry)).filter((entry) => Boolean(entry))
253
- : [];
254
- if (requestPaths.length === 0 && !route && targets.length === 0)
255
- return null;
256
- return {
257
- ...(requestPaths.length > 0 ? { requestPaths } : {}),
258
- ...(route ? { route } : {}),
259
- ...(targets.length > 0 ? { targets } : {}),
260
- };
261
- }
262
- function normalizeMetadataRecord(value) {
263
- if (!value || typeof value !== "object" || Array.isArray(value))
264
- return null;
265
- const normalized = {};
266
- for (const [key, entry] of Object.entries(value)) {
267
- const normalizedKey = normalizeOptionalString(key);
268
- if (!normalizedKey)
269
- continue;
270
- if (entry === null ||
271
- typeof entry === "string" ||
272
- typeof entry === "number" ||
273
- typeof entry === "boolean") {
274
- normalized[normalizedKey] = entry;
275
- }
276
- }
277
- return Object.keys(normalized).length > 0 ? normalized : null;
278
- }
279
- function normalizeStringArray(value) {
280
- if (!Array.isArray(value))
281
- return [];
282
- return value.map((entry) => normalizeOptionalString(entry)).filter((entry) => Boolean(entry));
283
- }
284
- function normalizeOptionalString(value) {
285
- if (typeof value !== "string")
286
- return null;
287
- const normalized = value.trim();
288
- return normalized.length > 0 ? normalized : null;
289
- }
290
- function isSetValue(set, value) {
291
- return typeof value === "string" && set.has(value);
292
- }
293
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAyNhD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AACzG,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAChF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAsB,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC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M,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACjH,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAc;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AAED,SAAS,UAAU,CAAmB,GAAmB,EAAE,KAAc;IACvE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,KAAU,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,25 +0,0 @@
1
- {
2
- "name": "@elench/testkit-protocol",
3
- "version": "0.1.132",
4
- "description": "Shared browser protocol for testkit bridge and extension consumers",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "default": "./dist/index.js"
12
- },
13
- "./package.json": "./package.json"
14
- },
15
- "files": [
16
- "dist/",
17
- "package.json"
18
- ],
19
- "scripts": {
20
- "build": "tsc -p tsconfig.build.json",
21
- "clean": "rm -rf dist",
22
- "typecheck": "tsc -p tsconfig.json --noEmit"
23
- },
24
- "private": false
25
- }