@shivaedev/test-story 0.33.0 → 0.34.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 +20 -0
- package/README.md +46 -11
- package/dist/server/adapters/installOutbound.d.ts.map +1 -0
- package/dist/server/{internal → adapters}/installOutbound.js +38 -12
- package/dist/server/adapters/installOutbound.js.map +1 -0
- package/dist/server/adapters/screenAct.d.ts +1 -1
- package/dist/server/adapters/screenAct.d.ts.map +1 -1
- package/dist/server/adapters/screenAct.js.map +1 -1
- package/dist/server/adapters/screenDialogs.d.ts +2 -0
- package/dist/server/adapters/screenDialogs.d.ts.map +1 -0
- package/dist/server/adapters/screenDialogs.js +9 -0
- package/dist/server/adapters/screenDialogs.js.map +1 -0
- package/dist/server/adapters/screenElements.d.ts +3 -0
- package/dist/server/adapters/screenElements.d.ts.map +1 -1
- package/dist/server/adapters/screenElements.js +9 -0
- package/dist/server/adapters/screenElements.js.map +1 -1
- package/dist/server/adapters/screenQueries.d.ts +2 -0
- package/dist/server/adapters/screenQueries.d.ts.map +1 -1
- package/dist/server/adapters/screenQueries.js +27 -3
- package/dist/server/adapters/screenQueries.js.map +1 -1
- package/dist/server/adapters/writeSnapshot.d.ts +3 -0
- package/dist/server/adapters/writeSnapshot.d.ts.map +1 -0
- package/dist/server/adapters/writeSnapshot.js +24 -0
- package/dist/server/adapters/writeSnapshot.js.map +1 -0
- package/dist/server/browserReads.d.ts +2 -2
- package/dist/server/browserReads.d.ts.map +1 -1
- package/dist/server/domEnvironment.config.js +1 -1
- package/dist/server/fakeHttpService.d.ts +2 -0
- package/dist/server/fakeHttpService.d.ts.map +1 -1
- package/dist/server/fakeHttpService.js +7 -5
- package/dist/server/fakeHttpService.js.map +1 -1
- package/dist/server/internal/browserReadObserver.d.ts +1 -1
- package/dist/server/internal/browserReadObserver.d.ts.map +1 -1
- package/dist/server/internal/browserReadObserver.js +15 -1
- package/dist/server/internal/browserReadObserver.js.map +1 -1
- package/dist/server/internal/browserSubscriptions.d.ts +2 -1
- package/dist/server/internal/browserSubscriptions.d.ts.map +1 -1
- package/dist/server/internal/browserSubscriptions.js +11 -3
- package/dist/server/internal/browserSubscriptions.js.map +1 -1
- package/dist/server/internal/engineSnapshot.d.ts.map +1 -1
- package/dist/server/internal/engineSnapshot.js +2 -13
- package/dist/server/internal/engineSnapshot.js.map +1 -1
- package/dist/server/internal/failureReport.js +5 -2
- package/dist/server/internal/failureReport.js.map +1 -1
- package/dist/server/internal/fakeHttpAnswer.d.ts.map +1 -1
- package/dist/server/internal/fakeHttpAnswer.js +12 -4
- package/dist/server/internal/fakeHttpAnswer.js.map +1 -1
- package/dist/server/internal/fakeHttpReceive.d.ts +1 -1
- package/dist/server/internal/fakeHttpReceive.d.ts.map +1 -1
- package/dist/server/internal/fakeHttpReceive.js +4 -7
- package/dist/server/internal/fakeHttpReceive.js.map +1 -1
- package/dist/server/internal/fakeHttpSignals.d.ts +10 -0
- package/dist/server/internal/fakeHttpSignals.d.ts.map +1 -0
- package/dist/server/internal/fakeHttpSignals.js +26 -0
- package/dist/server/internal/fakeHttpSignals.js.map +1 -0
- package/dist/server/internal/nextClientHint.d.ts +2 -1
- package/dist/server/internal/nextClientHint.d.ts.map +1 -1
- package/dist/server/internal/nextClientHint.js +8 -1
- package/dist/server/internal/nextClientHint.js.map +1 -1
- package/dist/server/internal/observeBrowser.d.ts +1 -1
- package/dist/server/internal/screenReadouts.d.ts +2 -0
- package/dist/server/internal/screenReadouts.d.ts.map +1 -1
- package/dist/server/internal/screenReadouts.js +13 -1
- package/dist/server/internal/screenReadouts.js.map +1 -1
- package/dist/server/memberScreens.d.ts.map +1 -1
- package/dist/server/memberScreens.js +1 -0
- package/dist/server/memberScreens.js.map +1 -1
- package/dist/server/routeOutbound.js +1 -1
- package/dist/server/routeOutbound.js.map +1 -1
- package/dist/server/screenDriver.d.ts +7 -3
- package/dist/server/screenDriver.d.ts.map +1 -1
- package/dist/server/screenDriver.js +13 -3
- package/dist/server/screenDriver.js.map +1 -1
- package/package.json +6 -6
- package/src/server/{internal → adapters}/installOutbound.ts +47 -12
- package/src/server/adapters/screenAct.ts +3 -3
- package/src/server/adapters/screenDialogs.ts +12 -0
- package/src/server/adapters/screenElements.ts +9 -0
- package/src/server/adapters/screenQueries.ts +31 -5
- package/src/server/adapters/writeSnapshot.ts +25 -0
- package/src/server/browserReads.ts +1 -1
- package/src/server/domEnvironment.config.ts +1 -1
- package/src/server/fakeHttpService.ts +7 -5
- package/src/server/internal/browserReadObserver.ts +15 -1
- package/src/server/internal/browserSubscriptions.ts +11 -3
- package/src/server/internal/engineSnapshot.ts +2 -20
- package/src/server/internal/failureReport.ts +6 -2
- package/src/server/internal/fakeHttpAnswer.ts +11 -4
- package/src/server/internal/fakeHttpReceive.ts +4 -7
- package/src/server/internal/fakeHttpSignals.ts +28 -0
- package/src/server/internal/nextClientHint.ts +12 -3
- package/src/server/internal/screenReadouts.ts +13 -1
- package/src/server/memberScreens.ts +1 -0
- package/src/server/routeOutbound.ts +1 -1
- package/src/server/screenDriver.ts +20 -9
- package/dist/server/internal/installOutbound.d.ts.map +0 -1
- package/dist/server/internal/installOutbound.js.map +0 -1
- /package/dist/server/{internal → adapters}/installOutbound.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memberScreens.js","sourceRoot":"","sources":["../../src/server/memberScreens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAkB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAS9D,MAAM,UAAU,aAAa,CAAe,OAI3C;IACA,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAChD,OAAO;QACN,IAAI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OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EACzC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mEAAmE,CAAC,CACjI,CAAC;gBACF,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;YAClE,CAAC;SACD,CAAC;KACF,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
+
import { installOutbound } from "#adapters/installOutbound.ts";
|
|
2
3
|
import { inDom } from "#internal/domDocument.ts";
|
|
3
|
-
import { installOutbound } from "#internal/installOutbound.ts";
|
|
4
4
|
export function routeOutbound(routes, options = {}) {
|
|
5
5
|
return Effect.acquireRelease(Effect.promise(() => installOutbound(routes, !options.passthrough || inDom())), (restore) => Effect.sync(restore)).pipe(Effect.asVoid);
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeOutbound.js","sourceRoot":"","sources":["../../src/server/routeOutbound.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"routeOutbound.js","sourceRoot":"","sources":["../../src/server/routeOutbound.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,MAAM,UAAU,aAAa,CAAC,MAAwC,EAAE,OAAO,GAAuC,EAAE;IACvH,OAAO,MAAM,CAAC,cAAc,CAC3B,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,KAAK,EAAE,CAAC,CAAC,EAC9E,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CACjC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
import type * as Stream from "effect/Stream";
|
|
3
3
|
import type { ClientActivity } from "@shivaedev/contract/clientActivity.ts";
|
|
4
|
+
import type { SignalNotReceived } from "#until.ts";
|
|
4
5
|
export type ScreenTarget = string | {
|
|
5
6
|
readonly role: string;
|
|
6
7
|
readonly name: string | RegExp;
|
|
@@ -25,16 +26,17 @@ declare const MissingClientActivity_base: new <A extends Record<string, any> = {
|
|
|
25
26
|
export declare class MissingClientActivity extends MissingClientActivity_base {
|
|
26
27
|
readonly message = "Cannot wait for a live hint without client activity.\nhelp: Supply pending: clientActivity(client) from @shivaedev/contract/clientActivity.ts.";
|
|
27
28
|
}
|
|
28
|
-
export type ScreenDriver<E = never, THintError = MissingClientActivity> = Omit<ReturnType<typeof makeScreenActions>, "settle" | "nextLiveHint"> & {
|
|
29
|
+
export type ScreenDriver<E = never, THintError = MissingClientActivity | SignalNotReceived> = Omit<ReturnType<typeof makeScreenActions>, "settle" | "nextLiveHint"> & {
|
|
29
30
|
nextLiveHint: () => Effect.Effect<void, THintError>;
|
|
30
31
|
settle: (options?: {
|
|
31
32
|
readonly timeoutMs?: number;
|
|
32
33
|
}) => Effect.Effect<void, E>;
|
|
34
|
+
dialog: (target: ScreenTarget) => ScreenDriver<E, THintError>;
|
|
33
35
|
within: (container: ScreenTarget | HTMLElement) => ScreenDriver<E, THintError>;
|
|
34
36
|
};
|
|
35
37
|
export declare function screenDriver(options: ScreenDriverOptions & {
|
|
36
38
|
readonly pending: ClientActivity;
|
|
37
|
-
}): ScreenDriver<never,
|
|
39
|
+
}): ScreenDriver<never, SignalNotReceived>;
|
|
38
40
|
export declare function screenDriver(options: ScreenDriverOptions & {
|
|
39
41
|
readonly pending: (() => boolean) | Stream.Stream<boolean>;
|
|
40
42
|
}): ScreenDriver;
|
|
@@ -44,6 +46,8 @@ declare function makeScreenActions({ root, pending, tell, act, timeoutMs, loadin
|
|
|
44
46
|
name: string;
|
|
45
47
|
role: string | null;
|
|
46
48
|
};
|
|
49
|
+
labelledText: (label: string | RegExp) => string;
|
|
50
|
+
table: (label: string | RegExp) => string[][];
|
|
47
51
|
text: (selector?: ScreenTarget) => string;
|
|
48
52
|
value: (selector: ScreenTarget) => string;
|
|
49
53
|
find: (target: ScreenTarget, settings?: {
|
|
@@ -60,7 +64,7 @@ declare function makeScreenActions({ root, pending, tell, act, timeoutMs, loadin
|
|
|
60
64
|
}) => Effect.Effect<void, never, never>;
|
|
61
65
|
click: (selector: ScreenTarget) => Effect.Effect<void, never, never>;
|
|
62
66
|
enter: (selector: ScreenTarget, value: string) => Effect.Effect<void, never, never>;
|
|
63
|
-
nextLiveHint: () => Effect.Effect<void,
|
|
67
|
+
nextLiveHint: () => Effect.Effect<void, SignalNotReceived, never> | Effect.Effect<never, MissingClientActivity, never>;
|
|
64
68
|
select: (selector: ScreenTarget, value: string) => Effect.Effect<void, never, never>;
|
|
65
69
|
settle: (settings?: {
|
|
66
70
|
readonly timeoutMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenDriver.d.ts","sourceRoot":"","sources":["../../src/server/screenDriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAQ5E,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,M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,YAAY,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;CAC/E,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CAAE,GAAG,YAAY,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAC1I,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;CAAE,GAAG,YAAY,CAAC;AAC1I,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC;AA8B/F,iBAAS,iBAAiB,CACzB,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAA0B,EAAE,SAAgB,EAAE,gBAAyB,EAAE,EAAE,mBAAmB,EACrH,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;sBAeG,YAAY;sBAOZ,YAAY,SAAS,MAAM;;uBAO1B,YAAY,SAAS,MAAM;wBAE1B;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;wBAEhC,YAAY;EAEhC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Data from "effect/Data";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import { withLive } from "@shivaedev/test/withLive.ts";
|
|
4
|
+
import { screenAct } from "#adapters/screenAct.ts";
|
|
4
5
|
import { screenElements } from "#adapters/screenElements.ts";
|
|
5
6
|
import { nextClientHint } from "#internal/nextClientHint.ts";
|
|
6
7
|
import { targetName } from "#internal/screenAccessibility.ts";
|
|
@@ -15,18 +16,27 @@ export class MissingClientActivity extends Data.TaggedError("MissingClientActivi
|
|
|
15
16
|
export function screenDriver(options) {
|
|
16
17
|
return makeDriver(options, true);
|
|
17
18
|
}
|
|
18
|
-
function makeDriver(options, dialogs) {
|
|
19
|
+
function makeDriver(options, dialogs, dialogOwner) {
|
|
19
20
|
const suppliedRoot = options.root;
|
|
20
21
|
const root = typeof suppliedRoot === "function" ? suppliedRoot : () => suppliedRoot;
|
|
21
22
|
const elements = screenElements(root, dialogs);
|
|
23
|
+
const owner = dialogOwner ?? root;
|
|
24
|
+
const dialogElements = screenElements(owner);
|
|
22
25
|
return {
|
|
23
26
|
...makeScreenActions(options, dialogs),
|
|
27
|
+
dialog: (target) => {
|
|
28
|
+
function dialogRoot() {
|
|
29
|
+
return dialogElements.dialog(target);
|
|
30
|
+
}
|
|
31
|
+
dialogRoot();
|
|
32
|
+
return makeDriver({ ...options, root: dialogRoot }, false, owner);
|
|
33
|
+
},
|
|
24
34
|
within: (container) => {
|
|
25
35
|
function scopedRoot() {
|
|
26
36
|
return container instanceof HTMLElement ? elements.rendered(container, container.tagName.toLowerCase()) : elements.element(container);
|
|
27
37
|
}
|
|
28
38
|
scopedRoot();
|
|
29
|
-
return makeDriver({ ...options, root: scopedRoot }, false);
|
|
39
|
+
return makeDriver({ ...options, root: scopedRoot }, false, owner);
|
|
30
40
|
},
|
|
31
41
|
};
|
|
32
42
|
}
|
|
@@ -54,7 +64,7 @@ function makeScreenActions({ root, pending, tell, act = (action) => action(), ti
|
|
|
54
64
|
if (pending === undefined || typeof pending === "function" || !("current" in pending)) {
|
|
55
65
|
return Effect.fail(new MissingClientActivity());
|
|
56
66
|
}
|
|
57
|
-
return withLive(Effect.sync(() => tell("wait for the next live hint")).pipe(Effect.andThen(
|
|
67
|
+
return withLive(Effect.sync(() => tell("wait for the next live hint")).pipe(Effect.andThen(screenAct(act, nextClientHint(pending)))));
|
|
58
68
|
},
|
|
59
69
|
select: (selector, value) => perform(`select ${JSON.stringify(value)} in ${targetName(selector)}`, () => elements.select(selector, value)),
|
|
60
70
|
settle: (settings) => pending === undefined ? Effect.fail(new MissingScreenPending()) : waits.settle(settings),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenDriver.js","sourceRoot":"","sources":["../../src/server/screenDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"screenDriver.js","sourceRoot":"","sources":["../../src/server/screenDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAcvD,MAAM,OAAO,oBAAqB,SAAQ,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC;IAC/D,OAAO,GACxB,wMAAwM,CAAC;CAC1M;AAED,MAAM,OAAO,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC;IACjE,OAAO,GACxB,gJAAgJ,CAAC;CAClJ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AAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,EAAE,CAAC;KACrI,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/test-story",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Tests that read like stories over the real engine: a story kit per engine with its own it, traits per feature, and a failure that prints the story, where it stopped and the engine's state",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/test-story#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"README.md"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@shivaedev/contract": "0.
|
|
51
|
-
"@shivaedev/test": "0.
|
|
52
|
-
"@shivaedev/test-sql": "0.16.
|
|
50
|
+
"@shivaedev/contract": "0.31.0",
|
|
51
|
+
"@shivaedev/test": "0.13.0",
|
|
52
|
+
"@shivaedev/test-sql": "0.16.2",
|
|
53
53
|
"dom-accessibility-api": "0.7.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@effect/platform-node": "4.0.6",
|
|
58
58
|
"@effect/sql-pg": "4.0.6",
|
|
59
59
|
"@effect/vitest": "4.0.6",
|
|
60
|
-
"@shivaedev/quality": "0.
|
|
61
|
-
"@shivaedev/react": "0.
|
|
60
|
+
"@shivaedev/quality": "0.56.0",
|
|
61
|
+
"@shivaedev/react": "0.34.0",
|
|
62
62
|
"@types/node": "24.19.2",
|
|
63
63
|
"@types/react": "19.3.0",
|
|
64
64
|
"@types/react-dom": "19.3.0",
|
|
@@ -13,11 +13,28 @@ function isDispatcher(value: unknown): value is Dispatcher {
|
|
|
13
13
|
return typeof value === "object" && value !== null && "dispatch" in value && typeof value.dispatch === "function";
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
interface Registration {
|
|
17
|
+
readonly origins: ReadonlyMap<string, string>;
|
|
18
|
+
refused?: Error;
|
|
19
|
+
readonly strict: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const registrations = new Set<Registration>();
|
|
23
|
+
let restoreDispatchers: (() => void) | undefined;
|
|
24
|
+
|
|
25
|
+
function routingFor(hostname: string) {
|
|
26
|
+
let target: string | undefined;
|
|
27
|
+
let strict: Registration | undefined;
|
|
28
|
+
for (const registration of registrations) {
|
|
29
|
+
target = registration.origins.get(hostname) ?? target;
|
|
30
|
+
if (registration.strict) {
|
|
31
|
+
strict = registration;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { strict, target };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function installDispatchers() {
|
|
21
38
|
const slots = ["undici.globalDispatcher.1", "undici.globalDispatcher.2"].flatMap((name) => {
|
|
22
39
|
const key = Symbol.for(name);
|
|
23
40
|
const previous: unknown = Reflect.get(globalThis, key);
|
|
@@ -36,15 +53,15 @@ export async function installOutbound(routes: Readonly<Record<string, string>>,
|
|
|
36
53
|
const router: Dispatcher = {
|
|
37
54
|
dispatch(options, handler) {
|
|
38
55
|
const hostname = new URL(options.origin).hostname;
|
|
39
|
-
const target =
|
|
56
|
+
const { strict, target } = routingFor(hostname);
|
|
40
57
|
if (
|
|
41
|
-
strict
|
|
58
|
+
strict !== undefined
|
|
42
59
|
&& target === undefined
|
|
43
60
|
&& !["localhost", "[::1]"].includes(hostname)
|
|
44
61
|
&& !(isIP(hostname) === 4 && hostname.startsWith("127."))
|
|
45
62
|
) {
|
|
46
|
-
refused = unrouted(hostname);
|
|
47
|
-
throw refused;
|
|
63
|
+
strict.refused = unrouted(hostname);
|
|
64
|
+
throw strict.refused;
|
|
48
65
|
}
|
|
49
66
|
return previous.dispatch(target === undefined ? options : { ...options, origin: target }, handler);
|
|
50
67
|
},
|
|
@@ -55,10 +72,28 @@ export async function installOutbound(routes: Readonly<Record<string, string>>,
|
|
|
55
72
|
restore();
|
|
56
73
|
throw error;
|
|
57
74
|
}
|
|
75
|
+
return restore;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export async function installOutbound(routes: Readonly<Record<string, string>>, strict = true) {
|
|
79
|
+
const registration: Registration = {
|
|
80
|
+
origins: new Map(Object.entries(routes).map(([hostname, target]) => [hostname, new URL(target).origin])),
|
|
81
|
+
strict,
|
|
82
|
+
};
|
|
83
|
+
// A data URL initializes Node's bundled Undici without sending an HTTP request.
|
|
84
|
+
await fetch("data:,");
|
|
85
|
+
if (restoreDispatchers === undefined) {
|
|
86
|
+
restoreDispatchers = installDispatchers();
|
|
87
|
+
}
|
|
88
|
+
registrations.add(registration);
|
|
58
89
|
return () => {
|
|
59
|
-
|
|
60
|
-
if (
|
|
61
|
-
|
|
90
|
+
registrations.delete(registration);
|
|
91
|
+
if (registrations.size === 0) {
|
|
92
|
+
restoreDispatchers?.();
|
|
93
|
+
restoreDispatchers = undefined;
|
|
94
|
+
}
|
|
95
|
+
if (registration.refused !== undefined) {
|
|
96
|
+
throw registration.refused;
|
|
62
97
|
}
|
|
63
98
|
};
|
|
64
99
|
}
|
|
@@ -2,9 +2,9 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as Exit from "effect/Exit";
|
|
3
3
|
import type { ScreenDriverOptions } from "#screenDriver.ts";
|
|
4
4
|
|
|
5
|
-
export function screenAct(act: NonNullable<ScreenDriverOptions["act"]>, action: Effect.Effect<void>) {
|
|
6
|
-
return Effect.callback<void>((resume, signal) => {
|
|
7
|
-
let outcome: Exit.Exit<void> = Exit.void;
|
|
5
|
+
export function screenAct<E>(act: NonNullable<ScreenDriverOptions["act"]>, action: Effect.Effect<void, E>) {
|
|
6
|
+
return Effect.callback<void, E>((resume, signal) => {
|
|
7
|
+
let outcome: Exit.Exit<void, E> = Exit.void;
|
|
8
8
|
const completed = Promise.resolve(
|
|
9
9
|
act(async () => {
|
|
10
10
|
// A rejected callback leaves React's act queue open, so deliver failure after act closes.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const DIALOG_SELECTOR = 'dialog,[role="dialog"],[role="alertdialog"]';
|
|
2
|
+
|
|
3
|
+
export function screenDialogs(root: HTMLElement) {
|
|
4
|
+
const member = root.closest("[data-story-member]");
|
|
5
|
+
const controls = member
|
|
6
|
+
? [...member.querySelectorAll("[aria-controls]")].flatMap((element) => element.getAttribute("aria-controls")?.split(/\s+/u) ?? [])
|
|
7
|
+
: [];
|
|
8
|
+
return [...root.ownerDocument.body.querySelectorAll<HTMLElement>(DIALOG_SELECTOR)].filter(
|
|
9
|
+
(dialog) =>
|
|
10
|
+
!dialog.matches("dialog:not([open])") && (member === null || member.contains(dialog) || (dialog.id !== "" && controls.includes(dialog.id))),
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -39,6 +39,7 @@ export function screenElements(root: () => HTMLElement, dialogs = true) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return {
|
|
42
|
+
dialog: queries.dialogElement,
|
|
42
43
|
element,
|
|
43
44
|
enabled,
|
|
44
45
|
enter: (selector: ScreenTarget, value: string) => {
|
|
@@ -62,6 +63,7 @@ export function screenElements(root: () => HTMLElement, dialogs = true) {
|
|
|
62
63
|
return found;
|
|
63
64
|
},
|
|
64
65
|
input,
|
|
66
|
+
labelled: queries.labelledElement,
|
|
65
67
|
matches: queries.matches,
|
|
66
68
|
rendered,
|
|
67
69
|
select: (selector: ScreenTarget, value: string) => {
|
|
@@ -77,6 +79,13 @@ export function screenElements(root: () => HTMLElement, dialogs = true) {
|
|
|
77
79
|
field.value = value;
|
|
78
80
|
field.dispatchEvent(new Event("change", { bubbles: true }));
|
|
79
81
|
},
|
|
82
|
+
table: (selector: ScreenTarget) => {
|
|
83
|
+
const found = element(selector);
|
|
84
|
+
if (!(found instanceof HTMLTableElement)) {
|
|
85
|
+
throw new Error(`The screen's ${targetName(selector)} is not an HTML table.\nhelp: Select a native table to read its rows and cells.`);
|
|
86
|
+
}
|
|
87
|
+
return found;
|
|
88
|
+
},
|
|
80
89
|
text: screenText,
|
|
81
90
|
textElement: queries.textElement,
|
|
82
91
|
};
|
|
@@ -2,6 +2,7 @@ import { isInaccessible } from "dom-accessibility-api";
|
|
|
2
2
|
import { accessibility, isRendered, targetName } from "#internal/screenAccessibility.ts";
|
|
3
3
|
import { screenText } from "#internal/screenText.ts";
|
|
4
4
|
import type { ScreenTarget } from "#screenDriver.ts";
|
|
5
|
+
import { screenDialogs } from "./screenDialogs.ts";
|
|
5
6
|
|
|
6
7
|
function matchesText(value: string, expected: string | RegExp) {
|
|
7
8
|
return typeof expected === "string" ? value === expected : new RegExp(expected.source, expected.flags).test(value);
|
|
@@ -11,11 +12,7 @@ export function screenQueries(root: () => HTMLElement, dialogs: boolean) {
|
|
|
11
12
|
function query(selector: string) {
|
|
12
13
|
const current = root();
|
|
13
14
|
const found = new Set(current.querySelectorAll<HTMLElement>(selector));
|
|
14
|
-
const portals = dialogs
|
|
15
|
-
? [...current.ownerDocument.querySelectorAll<HTMLElement>('dialog,[role="dialog"],[role="alertdialog"]')].filter(
|
|
16
|
-
(dialog) => !current.contains(dialog),
|
|
17
|
-
)
|
|
18
|
-
: [];
|
|
15
|
+
const portals = dialogs ? screenDialogs(current).filter((dialog) => !current.contains(dialog)) : [];
|
|
19
16
|
for (const dialog of portals) {
|
|
20
17
|
if (dialog.matches(selector)) {
|
|
21
18
|
found.add(dialog);
|
|
@@ -39,6 +36,35 @@ export function screenQueries(root: () => HTMLElement, dialogs: boolean) {
|
|
|
39
36
|
return candidates().filter(({ role, name }) => role === target.role && matchesText(name, target.name));
|
|
40
37
|
}
|
|
41
38
|
return {
|
|
39
|
+
dialogElement: (target: ScreenTarget) => {
|
|
40
|
+
const matches = screenDialogs(root()).filter((dialog) => {
|
|
41
|
+
if (!isRendered(dialog) || isInaccessible(dialog)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (typeof target === "string") {
|
|
45
|
+
return dialog.matches(target);
|
|
46
|
+
}
|
|
47
|
+
const { name, role } = accessibility(dialog);
|
|
48
|
+
return role === target.role && matchesText(name, target.name);
|
|
49
|
+
});
|
|
50
|
+
const found = matches[0];
|
|
51
|
+
if (matches.length !== 1 || found === undefined) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`The screen has ${matches.length} dialogs for ${targetName(target)}.\nhelp: Identify exactly one visible dialog owned by this screen; link body portals from the member's trigger with aria-controls.`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return found;
|
|
57
|
+
},
|
|
58
|
+
labelledElement: (name: string | RegExp) => {
|
|
59
|
+
const matches = query("[aria-label],[aria-labelledby],button,input,textarea,select,output,meter,progress").filter(
|
|
60
|
+
(element) => isRendered(element) && !isInaccessible(element) && matchesText(accessibility(element).name, name),
|
|
61
|
+
);
|
|
62
|
+
const found = matches[0];
|
|
63
|
+
if (matches.length !== 1 || found === undefined) {
|
|
64
|
+
throw new Error(`The screen has ${matches.length} elements labelled ${String(name)}.\nhelp: Use a label for exactly one visible readout.`);
|
|
65
|
+
}
|
|
66
|
+
return found;
|
|
67
|
+
},
|
|
42
68
|
matches: (target: ScreenTarget) =>
|
|
43
69
|
(typeof target === "string" ? query(target).filter(isRendered) : roles(target).map(({ element }) => element)).filter(
|
|
44
70
|
(element) => element.isConnected,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { basename, dirname, join, relative } from "node:path";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import type { FailedTest } from "#internal/failureReport.ts";
|
|
5
|
+
import { describeValue, toJson } from "#internal/render.ts";
|
|
6
|
+
import { wrap } from "#internal/wrap.ts";
|
|
7
|
+
|
|
8
|
+
function slug(text: string): string {
|
|
9
|
+
return text
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.replaceAll(/[^a-z0-9.]+/gu, "-")
|
|
12
|
+
.slice(0, 80);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function writeSnapshot(name: string, test: FailedTest, value: unknown, characters: number): string[] {
|
|
16
|
+
const heading = `The ${name} when the test failed`;
|
|
17
|
+
const file = join(process.cwd(), "node_modules", ".cache", "test-story", `${slug(basename(test.file))}--${slug(test.name)}--${slug(name)}.json`);
|
|
18
|
+
try {
|
|
19
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
20
|
+
writeFileSync(file, toJson(value, 2));
|
|
21
|
+
} catch (error) {
|
|
22
|
+
return wrap(`${heading} could not be written to ${relative(process.cwd(), file)}: ${describeValue(error)}`);
|
|
23
|
+
}
|
|
24
|
+
return wrap(`${heading} is ${characters} characters of JSON, too long to print here. Read it in ${relative(process.cwd(), file)}`);
|
|
25
|
+
}
|
|
@@ -5,7 +5,7 @@ import type * as Socket from "effect/socket/Socket";
|
|
|
5
5
|
export type BrowserSubscription = {
|
|
6
6
|
readonly payload: unknown;
|
|
7
7
|
readonly tag: string;
|
|
8
|
-
} & ({ readonly state: "open" | "answered" } | { readonly state: "refused"; readonly refusalTag: string });
|
|
8
|
+
} & ({ readonly state: "open" | "answered" | "closed" } | { readonly state: "refused"; readonly refusalTag: string });
|
|
9
9
|
|
|
10
10
|
export interface BrowserRead {
|
|
11
11
|
readonly kind: "query" | "subscription";
|
|
@@ -9,7 +9,7 @@ const domEnvironment: Environment = {
|
|
|
9
9
|
// Vitest loads environments outside the project's source resolution conditions.
|
|
10
10
|
const load = createRequire(import.meta.url);
|
|
11
11
|
const { documentTransport }: typeof import("#internal/documentTransport.ts") = load("#internal/documentTransport.ts");
|
|
12
|
-
const { installOutbound }: typeof import("#
|
|
12
|
+
const { installOutbound }: typeof import("#adapters/installOutbound.ts") = load("#adapters/installOutbound.ts");
|
|
13
13
|
const { installDomTimers }: typeof import("#internal/installDomTimers.ts") = load("#internal/installDomTimers.ts");
|
|
14
14
|
const native = Object.fromEntries(
|
|
15
15
|
["fetch", "AbortController", "AbortSignal", "Headers", "Request", "Response"].map((name) => [name, Reflect.get(global, name)]),
|
|
@@ -3,8 +3,8 @@ import * as Clock from "effect/Clock";
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { fakeHttpControls } from "#internal/fakeHttpControls.ts";
|
|
5
5
|
import { fakeHttpReceive } from "#internal/fakeHttpReceive.ts";
|
|
6
|
+
import { fakeHttpSignals } from "#internal/fakeHttpSignals.ts";
|
|
6
7
|
import { loopbackServer } from "#internal/loopback.ts";
|
|
7
|
-
import { recordedSignals } from "#internal/recordedSignals.ts";
|
|
8
8
|
import { type UntilOptions, until } from "#until.ts";
|
|
9
9
|
|
|
10
10
|
export interface FakeHttpRequest {
|
|
@@ -76,11 +76,11 @@ export const fakeHttpService = Effect.fnUntraced(function* (options: FakeHttpSer
|
|
|
76
76
|
narrate?.(line);
|
|
77
77
|
}
|
|
78
78
|
const controls = fakeHttpControls(tell, () => clock.currentTimeMillisUnsafe());
|
|
79
|
-
const
|
|
80
|
-
const server = createServer((request, response) => fakeHttpReceive(request, response, options, requests, controls, tell,
|
|
79
|
+
const signals = fakeHttpSignals();
|
|
80
|
+
const server = createServer((request, response) => fakeHttpReceive(request, response, options, requests, controls, tell, signals.record));
|
|
81
81
|
const url = yield* loopbackServer(server);
|
|
82
82
|
|
|
83
|
-
yield* Effect.addFinalizer(() => Effect.sync(
|
|
83
|
+
yield* Effect.addFinalizer(() => Effect.sync(signals.close));
|
|
84
84
|
yield* Effect.addFinalizer(controls.close);
|
|
85
85
|
function checkRoute(route: string) {
|
|
86
86
|
if (!Object.hasOwn(options.routes, route)) {
|
|
@@ -88,6 +88,7 @@ export const fakeHttpService = Effect.fnUntraced(function* (options: FakeHttpSer
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
return {
|
|
91
|
+
completed: signals.completed,
|
|
91
92
|
fault: (route: string, fault: FakeHttpFault, scope?: FakeHttpScope) =>
|
|
92
93
|
Effect.sync(() => checkRoute(route)).pipe(Effect.andThen(controls.fault(route, fault, scope))),
|
|
93
94
|
hold: (route: string, holdOptions?: FakeHttpHoldOptions) =>
|
|
@@ -95,6 +96,7 @@ export const fakeHttpService = Effect.fnUntraced(function* (options: FakeHttpSer
|
|
|
95
96
|
narrate: (sink: (line: string) => void) => {
|
|
96
97
|
narrate = sink;
|
|
97
98
|
},
|
|
99
|
+
received: signals.received,
|
|
98
100
|
releaseOnArrival: (route: string, arrival: string, scope?: FakeHttpScope) =>
|
|
99
101
|
Effect.sync(() => {
|
|
100
102
|
checkRoute(route);
|
|
@@ -106,7 +108,7 @@ export const fakeHttpService = Effect.fnUntraced(function* (options: FakeHttpSer
|
|
|
106
108
|
scriptFault: (route: string, fault: FakeHttpFault, scriptOptions?: FakeHttpScriptOptions) =>
|
|
107
109
|
Effect.sync(() => checkRoute(route)).pipe(Effect.andThen(controls.scriptFault(route, fault, scriptOptions))),
|
|
108
110
|
stall: (route: string, scope?: FakeHttpScope) => Effect.sync(() => checkRoute(route)).pipe(Effect.andThen(controls.stall(route, scope))),
|
|
109
|
-
untilAbandoned: (matches: (request: FakeHttpRequestRecord) => boolean, wait: UntilOptions) => until(abandoned
|
|
111
|
+
untilAbandoned: (matches: (request: FakeHttpRequestRecord) => boolean, wait: UntilOptions) => until(signals.abandoned, matches, wait),
|
|
110
112
|
url,
|
|
111
113
|
};
|
|
112
114
|
});
|
|
@@ -35,6 +35,14 @@ export const browserReadObserver = Effect.fnUntraced(function* (contracts: Brows
|
|
|
35
35
|
observeProtocol: Effect.gen(function* () {
|
|
36
36
|
const underlying = yield* RpcClient.Protocol;
|
|
37
37
|
const listening = new Map<string, number>();
|
|
38
|
+
const closeClient = Effect.fnUntraced(function* (clientId: number) {
|
|
39
|
+
for (const [key, index] of listening) {
|
|
40
|
+
if (key.startsWith(`${clientId}:`)) {
|
|
41
|
+
yield* tracked.close(index);
|
|
42
|
+
listening.delete(key);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
38
46
|
function record(clientId: number, request: RpcMessage.RequestEncoded) {
|
|
39
47
|
if (subscriptionTags.has(request.tag)) {
|
|
40
48
|
listening.set(`${clientId}:${request.id}`, tracked.open(request.payload, request.tag));
|
|
@@ -44,6 +52,10 @@ export const browserReadObserver = Effect.fnUntraced(function* (contracts: Brows
|
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
const observeMessage = Effect.fnUntraced(function* (clientId: number, message: RpcMessage.FromServerEncoded) {
|
|
55
|
+
if (message._tag === "Defect" || message._tag === "ClientProtocolError") {
|
|
56
|
+
yield* closeClient(clientId);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
47
59
|
const key = "requestId" in message ? `${clientId}:${message.requestId}` : undefined;
|
|
48
60
|
yield* receive(key === undefined ? undefined : listening.get(key), message);
|
|
49
61
|
if (message._tag === "Exit") {
|
|
@@ -53,7 +65,9 @@ export const browserReadObserver = Effect.fnUntraced(function* (contracts: Brows
|
|
|
53
65
|
const protocol: RpcClient.Protocol["Service"] = {
|
|
54
66
|
...underlying,
|
|
55
67
|
run: (clientId, deliver) =>
|
|
56
|
-
underlying
|
|
68
|
+
underlying
|
|
69
|
+
.run(clientId, (message) => observeMessage(clientId, message).pipe(Effect.andThen(() => deliver(message))))
|
|
70
|
+
.pipe(Effect.ensuring(closeClient(clientId))),
|
|
57
71
|
send: (clientId, request, transferables) =>
|
|
58
72
|
Effect.gen(function* () {
|
|
59
73
|
if (request._tag === "Request") {
|
|
@@ -16,28 +16,36 @@ export const browserSubscriptions = Effect.sync(() => {
|
|
|
16
16
|
const waitForSubscriptions: Effect.Effect<void> = Effect.suspend(() =>
|
|
17
17
|
openings.every(({ state }) => state !== "open") ? Effect.void : Deferred.await(changed).pipe(Effect.andThen(waitForSubscriptions)),
|
|
18
18
|
);
|
|
19
|
+
function close(index: number) {
|
|
20
|
+
const opening = openings[index];
|
|
21
|
+
return opening?.state === "open" ? settle(index, { ...opening, state: "closed" }) : Effect.void;
|
|
22
|
+
}
|
|
19
23
|
return {
|
|
24
|
+
close,
|
|
20
25
|
open: (payload: unknown, tag: string) => {
|
|
21
26
|
openings.push({ payload, state: "open", tag });
|
|
22
27
|
return openings.length - 1;
|
|
23
28
|
},
|
|
24
29
|
receive: (index: number, message: RpcMessage.FromServerEncoded) => {
|
|
25
30
|
const opening = openings[index];
|
|
26
|
-
if (opening
|
|
31
|
+
if (opening?.state !== "open") {
|
|
27
32
|
return Effect.void;
|
|
28
33
|
}
|
|
29
34
|
if (message._tag === "Chunk" && message.values.length > 0) {
|
|
30
35
|
return settle(index, { ...opening, state: "answered" });
|
|
31
36
|
}
|
|
32
|
-
if (message._tag !== "Exit"
|
|
37
|
+
if (message._tag !== "Exit") {
|
|
33
38
|
return Effect.void;
|
|
34
39
|
}
|
|
40
|
+
if (message.exit._tag === "Success") {
|
|
41
|
+
return close(index);
|
|
42
|
+
}
|
|
35
43
|
for (const cause of message.exit.cause) {
|
|
36
44
|
if (cause._tag === "Fail" && Predicate.hasProperty(cause.error, "_tag") && typeof cause.error._tag === "string") {
|
|
37
45
|
return settle(index, { ...opening, refusalTag: cause.error._tag, state: "refused" });
|
|
38
46
|
}
|
|
39
47
|
}
|
|
40
|
-
return
|
|
48
|
+
return close(index);
|
|
41
49
|
},
|
|
42
50
|
subscriptions: () => openings.map((opening) => ({ ...opening })),
|
|
43
51
|
waitForSubscriptions,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { basename, dirname, join, relative } from "node:path";
|
|
3
|
-
import process from "node:process";
|
|
1
|
+
import { writeSnapshot } from "#adapters/writeSnapshot.ts";
|
|
4
2
|
import type { FailedTest } from "#internal/failureReport.ts";
|
|
5
3
|
import type { Subject } from "#internal/narration.ts";
|
|
6
4
|
import { describeValue, toJson } from "#internal/render.ts";
|
|
@@ -21,13 +19,6 @@ function snapshot<TEngine>(subject: Subject<TEngine>): Snapshot {
|
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
function slug(text: string): string {
|
|
25
|
-
return text
|
|
26
|
-
.toLowerCase()
|
|
27
|
-
.replaceAll(/[^a-z0-9.]+/gu, "-")
|
|
28
|
-
.slice(0, 80);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
22
|
export function engineSnapshot<TEngine>(subject: Subject<TEngine>, test: FailedTest): string[] {
|
|
32
23
|
const heading = `The ${subject.name} when the test failed`;
|
|
33
24
|
const taken = snapshot(subject);
|
|
@@ -38,14 +29,5 @@ export function engineSnapshot<TEngine>(subject: Subject<TEngine>, test: FailedT
|
|
|
38
29
|
if (json.length <= INLINE_CHARACTERS) {
|
|
39
30
|
return heading.length + 2 + json.length > WIDTH ? [`${heading}:`, ...wrapJson(json)] : [`${heading}: ${json}`];
|
|
40
31
|
}
|
|
41
|
-
|
|
42
|
-
process.cwd(),
|
|
43
|
-
"node_modules",
|
|
44
|
-
".cache",
|
|
45
|
-
"test-story",
|
|
46
|
-
`${slug(basename(test.file))}--${slug(test.name)}--${slug(subject.name)}.json`,
|
|
47
|
-
);
|
|
48
|
-
mkdirSync(dirname(file), { recursive: true });
|
|
49
|
-
writeFileSync(file, toJson(taken.value, 2));
|
|
50
|
-
return wrap(`${heading} is ${json.length} characters of JSON, too long to print here. Read it in ${relative(process.cwd(), file)}`);
|
|
32
|
+
return writeSnapshot(subject.name, test, taken.value, json.length);
|
|
51
33
|
}
|
|
@@ -56,7 +56,11 @@ function storyRows(narration: Narration, test: FailedTest): string[] {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function rerun(test: FailedTest): string {
|
|
59
|
-
const run = `Rerun: vitest run ${relative(process.cwd(), test.file)}`;
|
|
60
|
-
const filter = `-t
|
|
59
|
+
const run = `Rerun: vitest run ${shellQuote(relative(process.cwd(), test.file))}`;
|
|
60
|
+
const filter = `-t ${shellQuote(test.name.replaceAll(/[$()*+.?[\\\]^{|}]/gu, "\\$&"))}`;
|
|
61
61
|
return run.length + 1 + filter.length > WIDTH ? `${run} \\\n ${filter}` : `${run} ${filter}`;
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
function shellQuote(value: string): string {
|
|
65
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
66
|
+
}
|