@unotest/web 0.29.0 → 0.31.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.
@@ -120,9 +120,9 @@ declare function check(locator: Locator, options?: any): void;
120
120
  declare function uncheck(locator: Locator, options?: any): void;
121
121
 
122
122
  /**
123
- * hover(locator, { force?, timeout? })
123
+ * hover(locator, { force?, position?, timeout? })
124
124
  *
125
- * Hover over an element.
125
+ * Hover over an element. `position` is an {x, y} offset inside it — for a menu that only appears at one edge of a tall element.
126
126
  */
127
127
  declare function hover(locator: Locator, options?: any): void;
128
128
 
@@ -281,9 +281,16 @@ declare function randomNth(receiver: Locator): Locator;
281
281
  declare function screenshot(name?: string, options?: any): string;
282
282
 
283
283
  /**
284
- * evaluate(js, ...args) → any
284
+ * note(label, value)
285
285
  *
286
- * Run raw JS in the page context. Last resortprefer typed helpers. Returns JSON-serializable values only.
286
+ * Attach a labelled value to the current step: shown in the viewer under the step (also after the run) and kept in the run journal. Any valuea string, a number, an object (recorded as JSON). Secrets are masked; long values are cut at 4 KB. Use it for the question a data-driven case asked and the answer it got.
287
+ */
288
+ declare function note(label: string, value: any): void;
289
+
290
+ /**
291
+ * evaluate(js, arg?) → any
292
+ *
293
+ * Run raw JS in the page context. Last resort — prefer typed helpers. Returns JSON-serializable values only. Extra arguments reach the body as: none → nothing, exactly one → the value itself, two or more → ONE array (destructure `([a, b]) => …`).
287
294
  */
288
295
  declare function evaluate(jsBody: string, ...args: unknown[]): any;
289
296
 
@@ -511,6 +518,13 @@ declare function waitForJsonLine(path: string, filter: any, options?: any): any;
511
518
  */
512
519
  declare function assertNoJsonLine(path: string, filter: any, options?: any): void;
513
520
 
521
+ /**
522
+ * readJsonLine(path, filter) → object
523
+ *
524
+ * First matching line of a JSONL file that already exists, no wait: one read, same key filter as waitForJsonLine. FAILS at once when the file is missing or no line matches — use it for fixtures and finished exports, waitForJsonLine for a file still being written.
525
+ */
526
+ declare function readJsonLine(path: string, filter: any): any;
527
+
514
528
  /**
515
529
  * waitForFileCount(path, pattern, count, options?) → number
516
530
  *
@@ -654,7 +668,7 @@ declare function getUrl(): string;
654
668
  /**
655
669
  * log(...args)
656
670
  *
657
- * Write to the run trace.
671
+ * Write a line to the runner's output AND to the run journal, under the current step — visible in the viewer's System pane after the run too.
658
672
  */
659
673
  declare function log(message: any, ...args: unknown[]): void;
660
674
 
@@ -714,8 +728,18 @@ declare function waitForCount(locator: Locator, count: number, options?: any): v
714
728
  */
715
729
  declare function pause(ms: number): void;
716
730
 
717
- /** step(label, body)
731
+ /** step(label, [options,] body)
718
732
  *
719
733
  * Groups statements under a labelled block. Every direct child of a
720
- * test_* function must sit inside a step(...). */
734
+ * test_* function must sit inside a step(...). `{tag}` names the case a
735
+ * data-driven step is on. */
721
736
  declare function step(label: string, body: () => void): void;
737
+ declare function step(label: string, options: { tag: unknown }, body: () => void): void;
738
+ declare namespace step {
739
+ /** step.soft(label, [options,] body)
740
+ *
741
+ * A failure inside is recorded and the run continues after the block;
742
+ * the test still ends failed. Allowed inside test_* only. */
743
+ function soft(label: string, body: () => void): void;
744
+ function soft(label: string, options: { tag: unknown }, body: () => void): void;
745
+ }
@@ -1,21 +0,0 @@
1
- import { BlockStatement } from '@unotest/dsl';
2
-
3
- type LintSeverity = 'error' | 'warning' | 'info';
4
- interface LintDiagnostic {
5
- rule: string;
6
- severity: LintSeverity;
7
- message: string;
8
- line: number;
9
- col: number;
10
- }
11
- interface LintOptions {
12
- /** Per-rule severity override. Default severities live with each rule. */
13
- ruleSeverity?: Partial<Record<string, LintSeverity>>;
14
- /** Pass through if the agent provided documented justification — e.g. a
15
- * `// reason:` comment immediately above the line. The lexer doesn't
16
- * preserve comments today; for v1 we accept a flag from the caller. */
17
- allowDisambigByIndex?: boolean;
18
- }
19
- declare function lintAst(ast: BlockStatement, opts?: LintOptions): LintDiagnostic[];
20
-
21
- export { type LintDiagnostic as L, type LintSeverity as a, type LintOptions as b, lintAst as l };