@shivaedev/test-story 0.31.2 → 0.31.3
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 +6 -0
- package/README.md +2 -0
- package/dist/server/internal/documentTransport.d.ts.map +1 -1
- package/dist/server/internal/documentTransport.js +5 -2
- package/dist/server/internal/documentTransport.js.map +1 -1
- package/package.json +3 -3
- package/src/server/internal/documentTransport.ts +5 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -571,6 +571,8 @@ app.it(
|
|
|
571
571
|
|
|
572
572
|
Acquire hosts, workers and screens in per-story Scope so they inherit the story's Clock. An independent runtime or native HTTP handler must capture the Effect Context at acquisition, as with `HttpEffect.toWebHandlerWith(context)` or `Effect.runPromiseWith(context)`. Worker-scoped kit `layer` acquisition stays outside the per-story clock; shared services acquired there do not acquire a new clock for each story. Direct JavaScript wall-time reads are not replaced. Formatting stays with the application, including its locale and time zone.
|
|
573
573
|
|
|
574
|
+
Long jumps also expire signed-in sessions. With Better Auth, use `signInAgain(auth, userId)` from `@shivaedev/identity/server/better-auth/testing.ts` to mint a fresh session on the caller’s Clock for the same user. Replace the visitor’s headers, or pass its returned cookies to `seedCookies` for a browser. The starter’s app kit exposes `signsInAgain(name)` and its cookie kit exposes `browserSignsInAgain()` for these steps. Their TestClocks start at the present by default so Better Auth’s wall-clock endpoints accept minted sessions; an explicit story `clock` still takes precedence.
|
|
575
|
+
|
|
574
576
|
A live-clock kit still runs on real time when a story omits the override.
|
|
575
577
|
|
|
576
578
|
### Waiting for a timer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentTransport.d.ts","sourceRoot":"","sources":["../../../src/server/internal/documentTransport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAOnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"documentTransport.d.ts","sourceRoot":"","sources":["../../../src/server/internal/documentTransport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAOnD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,GAAG,iBAAiB,CA8CnF"}
|
|
@@ -14,8 +14,11 @@ export function documentTransport(fetch) {
|
|
|
14
14
|
let current = request;
|
|
15
15
|
let body = current.body === null ? null : Buffer.from(await current.arrayBuffer());
|
|
16
16
|
for (let redirects = 0; redirects <= 20; redirects += 1) {
|
|
17
|
-
const headers = FetchRequestHeaderUtility.getRequestHeaders({
|
|
18
|
-
|
|
17
|
+
const { Connection: _connection, ...headers } = FetchRequestHeaderUtility.getRequestHeaders({
|
|
18
|
+
browserFrame: frame,
|
|
19
|
+
request: current,
|
|
20
|
+
window,
|
|
21
|
+
});
|
|
19
22
|
const { release, response } = await documentRequest(fetch, current, body, headers);
|
|
20
23
|
const responseHeaders = documentResponseHeaders(response, current, frame);
|
|
21
24
|
const location = response.headers.get("location");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentTransport.js","sourceRoot":"","sources":["../../../src/server/internal/documentTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,OAAO,yBAAyB,MAAM,4DAA4D,CAAC;AACnG,OAAO,oBAAoB,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,MAAM,UAAU,iBAAiB,CAAC,KAA8B;IAC/D,OAAO;QACN,KAAK,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE;YAC3C,MA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,CAAC;gBAC5F,CAAC;gBACD,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;gBAC9B,OAAO,EAAE,CAAC;gBACV,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;oBACtD,MAAM,IAAI,KAAK,CAAC,0CAA0C,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;gBAC1E,CAAC;gBACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACtG,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;gBACvB,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAClB,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,6CAA6C,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,iBAAiB,CAAC,EAAE,OAAO,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,uDAAuD,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,qBAAqB,CAAC,CAAC;QAC5H,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/test-story",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.3",
|
|
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": {
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@shivaedev/contract": "0.30.0",
|
|
46
46
|
"@shivaedev/test": "0.12.0",
|
|
47
|
-
"@shivaedev/test-sql": "0.15.
|
|
47
|
+
"@shivaedev/test-sql": "0.15.3",
|
|
48
48
|
"dom-accessibility-api": "0.7.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@effect/atom-react": "4.0.6",
|
|
52
52
|
"@effect/platform-node": "4.0.6",
|
|
53
53
|
"@effect/vitest": "4.0.6",
|
|
54
|
-
"@shivaedev/quality": "0.
|
|
54
|
+
"@shivaedev/quality": "0.53.0",
|
|
55
55
|
"@types/node": "24.19.2",
|
|
56
56
|
"@types/react": "19.3.0",
|
|
57
57
|
"@types/react-dom": "19.3.0",
|
|
@@ -16,8 +16,11 @@ export function documentTransport(fetch: typeof globalThis.fetch): IFetchInterce
|
|
|
16
16
|
let current = request;
|
|
17
17
|
let body = current.body === null ? null : Buffer.from(await current.arrayBuffer());
|
|
18
18
|
for (let redirects = 0; redirects <= 20; redirects += 1) {
|
|
19
|
-
const headers = FetchRequestHeaderUtility.getRequestHeaders({
|
|
20
|
-
|
|
19
|
+
const { Connection: _connection, ...headers } = FetchRequestHeaderUtility.getRequestHeaders({
|
|
20
|
+
browserFrame: frame,
|
|
21
|
+
request: current,
|
|
22
|
+
window,
|
|
23
|
+
});
|
|
21
24
|
const { release, response } = await documentRequest(fetch, current, body, headers);
|
|
22
25
|
const responseHeaders = documentResponseHeaders(response, current, frame);
|
|
23
26
|
const location = response.headers.get("location");
|