@orkestrel/test 0.0.13 → 0.0.14
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/README.md +8 -11
- package/dist/src/browser/index.d.ts +41 -6
- package/dist/src/browser/index.js +5 -1
- package/dist/src/browser/index.js.map +1 -1
- package/dist/src/core/index.cjs +61 -1
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +81 -5
- package/dist/src/core/index.d.ts +81 -5
- package/dist/src/core/index.js +61 -1
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +183 -2
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +190 -7
- package/dist/src/server/index.d.ts +190 -7
- package/dist/src/server/index.js +183 -2
- package/dist/src/server/index.js.map +1 -1
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
# @orkestrel/test
|
|
2
2
|
|
|
3
|
-
The test helpers the `@orkestrel` fleet kept rewriting, published once
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[Limits](guides/test.md#limits) section states that rule, what it excluded, and the one door the
|
|
12
|
-
journey layer came through instead. Add it as a devDependency; nothing here runs in production code.
|
|
13
|
-
Part of the `@orkestrel` line.
|
|
3
|
+
> The test helpers the `@orkestrel` fleet kept rewriting, published once: families of what a test
|
|
4
|
+
> records, what it waits for, and what it owns, with a pair outside all of them and a browser
|
|
5
|
+
> journey layer beside them.
|
|
6
|
+
|
|
7
|
+
Add it as a devDependency and import the core from `@orkestrel/test`. A helper ships here only when
|
|
8
|
+
enough packages had already written their own; the guide's [Limits](guides/test.md#limits) section
|
|
9
|
+
states that rule, what it excluded, and the one door the journey layer came through instead. Nothing
|
|
10
|
+
here runs in production code. Part of the `@orkestrel` line.
|
|
14
11
|
|
|
15
12
|
It has **zero runtime dependencies**, and no exported signature names an `@orkestrel/*` type. Both
|
|
16
13
|
rules exist for one reason: a test helper hands its types straight into the consumer's assertions,
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads only inside Vitest Browser Mode, where it drives a real browser through the installed
|
|
3
|
+
* provider.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This entry imports `vitest/browser` at module scope, so importing it from a Node host throws at
|
|
7
|
+
* module load. That throw is the contract: it arrives at the import that caused it rather than
|
|
8
|
+
* inside the first helper call, and no Node host half-loads a surface whose every verb assumes the
|
|
9
|
+
* Browser Mode runner.
|
|
10
|
+
*
|
|
11
|
+
* A module that must load under Node as well reaches this entry through a dynamic import behind a
|
|
12
|
+
* DOM guard. A setup file that a Node project and a browser project both register is the case that
|
|
13
|
+
* needs it.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* let render: ((markup: string) => HTMLDivElement) | undefined
|
|
18
|
+
* if (typeof document !== 'undefined') {
|
|
19
|
+
* ;({ render } = await import('@orkestrel/test/browser'))
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
25
|
+
|
|
1
26
|
/**
|
|
2
27
|
* Names the interactive ARIA roles a bare accessible name is searched across.
|
|
3
28
|
*
|
|
@@ -45,7 +70,7 @@ export declare function blendColor(front: Color, back: Color): Color;
|
|
|
45
70
|
export declare function build<K extends keyof HTMLElementTagNameMap>(tag: K, options?: ElementOptions): HTMLElementTagNameMap[K];
|
|
46
71
|
|
|
47
72
|
/**
|
|
48
|
-
* Names the color a browser paints an unstyled document with.
|
|
73
|
+
* Names the color a browser paints an unstyled document with: opaque white.
|
|
49
74
|
*
|
|
50
75
|
* @remarks
|
|
51
76
|
* This is the floor a backdrop walk ends on wherever the caller wants the browser's own canvas
|
|
@@ -144,7 +169,7 @@ export declare const CAPTURE_STAGINGS = 4;
|
|
|
144
169
|
*/
|
|
145
170
|
export declare function captureFrame(options: FrameOptions): Promise<string>;
|
|
146
171
|
|
|
147
|
-
/** Represents one theme-and-viewport pair a capture run renders. */
|
|
172
|
+
/** Represents one theme-and-viewport pair a capture run renders, and the document change it needs first. */
|
|
148
173
|
export declare interface CaptureVariant {
|
|
149
174
|
/** Holds the variant's name, which is the second half of every filename the run writes. */
|
|
150
175
|
readonly name: string;
|
|
@@ -496,7 +521,7 @@ export declare function describeFocus(element: Element): string;
|
|
|
496
521
|
export declare function describeTree(element: Element): string;
|
|
497
522
|
|
|
498
523
|
/**
|
|
499
|
-
* Configures one built element.
|
|
524
|
+
* Configures one built element: its class list, its text, and its attributes.
|
|
500
525
|
*
|
|
501
526
|
* @remarks
|
|
502
527
|
* `classes` is written the way a `class` attribute is written — one space-separated string — so a
|
|
@@ -668,7 +693,7 @@ export declare function findRule(selector: string): CSSStyleRule | undefined;
|
|
|
668
693
|
*/
|
|
669
694
|
export declare const FOCUSABLE_SELECTOR = "a[href], area[href], button, input, select, summary, textarea, [tabindex]";
|
|
670
695
|
|
|
671
|
-
/** Configures one captured frame. */
|
|
696
|
+
/** Configures one captured frame: where it is written, the viewport it is shot at, and what it shoots. */
|
|
672
697
|
export declare interface FrameOptions {
|
|
673
698
|
/** Holds the frame's path, relative to the calling test file. */
|
|
674
699
|
readonly path: string;
|
|
@@ -681,7 +706,8 @@ export declare interface FrameOptions {
|
|
|
681
706
|
}
|
|
682
707
|
|
|
683
708
|
/**
|
|
684
|
-
* Represents one written frame
|
|
709
|
+
* Represents one written frame read back from the file a capture produced: its size in device
|
|
710
|
+
* pixels, and the single color its bottom row paints.
|
|
685
711
|
*
|
|
686
712
|
* @remarks
|
|
687
713
|
* The floor is the frame's bottom row, because that row is where coverage shows: a frame shot at a
|
|
@@ -833,6 +859,8 @@ export declare interface JournalInterface {
|
|
|
833
859
|
* @param action - What the run did, as one verb.
|
|
834
860
|
* @param trigger - The exact thing it did it to.
|
|
835
861
|
* @param result - What was observed on the surface after the step landed.
|
|
862
|
+
* @remarks The appended step is frozen. A step taken before `start` or after `stop` is not
|
|
863
|
+
* recorded at all.
|
|
836
864
|
*/
|
|
837
865
|
record(action: string, trigger: string, result: string): void;
|
|
838
866
|
}
|
|
@@ -1043,7 +1071,10 @@ export declare interface PortfolioInterface {
|
|
|
1043
1071
|
place(state: string, element?: Element): Promise<string | undefined>;
|
|
1044
1072
|
}
|
|
1045
1073
|
|
|
1046
|
-
/**
|
|
1074
|
+
/**
|
|
1075
|
+
* Configures a capture portfolio: the state registry, the variant matrix, this run's variant, where
|
|
1076
|
+
* it writes, and whether it writes at all.
|
|
1077
|
+
*/
|
|
1047
1078
|
export declare interface PortfolioOptions {
|
|
1048
1079
|
/**
|
|
1049
1080
|
* Lists every state name the journeys place, declared once. `place` refuses a name absent from
|
|
@@ -1799,6 +1830,10 @@ export declare function traverseAccessible(name: string): Promise<HTMLElement>;
|
|
|
1799
1830
|
* @param text - The text to type.
|
|
1800
1831
|
* @returns A promise resolving after every keystroke completes.
|
|
1801
1832
|
*
|
|
1833
|
+
* @remarks
|
|
1834
|
+
* The text is escaped against the provider's own key syntax, so a literal `{` or `[` is typed
|
|
1835
|
+
* rather than read as the start of a key sequence.
|
|
1836
|
+
*
|
|
1802
1837
|
* @example
|
|
1803
1838
|
* ```ts
|
|
1804
1839
|
* await typeAccessible('Runs', '3')
|
|
@@ -27,7 +27,7 @@ var ACCESSIBLE_ROLES = Object.freeze([
|
|
|
27
27
|
"treeitem"
|
|
28
28
|
]);
|
|
29
29
|
/**
|
|
30
|
-
* Names the color a browser paints an unstyled document with.
|
|
30
|
+
* Names the color a browser paints an unstyled document with: opaque white.
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
33
|
* This is the floor a backdrop walk ends on wherever the caller wants the browser's own canvas
|
|
@@ -435,6 +435,10 @@ async function clickDisclosure(name) {
|
|
|
435
435
|
* @param text - The text to type.
|
|
436
436
|
* @returns A promise resolving after every keystroke completes.
|
|
437
437
|
*
|
|
438
|
+
* @remarks
|
|
439
|
+
* The text is escaped against the provider's own key syntax, so a literal `{` or `[` is typed
|
|
440
|
+
* rather than read as the start of a key sequence.
|
|
441
|
+
*
|
|
438
442
|
* @example
|
|
439
443
|
* ```ts
|
|
440
444
|
* await typeAccessible('Runs', '3')
|