@fluojs/testing 2.0.0 → 3.0.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/README.ko.md +94 -12
- package/README.md +96 -12
- package/dist/babel-decorators-plugin.d.ts +1 -0
- package/dist/babel-decorators-plugin.d.ts.map +1 -1
- package/dist/babel-decorators-plugin.js +1 -0
- package/dist/byte-range-portability-consumer.test-fixture.d.ts +2 -0
- package/dist/byte-range-portability-consumer.test-fixture.d.ts.map +1 -0
- package/dist/byte-range-portability-consumer.test-fixture.js +11 -0
- package/dist/conformance/fetch-style-websocket-conformance.d.ts +1 -0
- package/dist/conformance/fetch-style-websocket-conformance.d.ts.map +1 -1
- package/dist/conformance/fetch-style-websocket-conformance.js +1 -1
- package/dist/conformance/platform-shell-lifecycle-conformance.d.ts +30 -0
- package/dist/conformance/platform-shell-lifecycle-conformance.d.ts.map +1 -0
- package/dist/conformance/platform-shell-lifecycle-conformance.js +259 -0
- package/dist/http.d.ts +2 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +8 -3
- package/dist/mock.js +1 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +45 -73
- package/dist/portability/error-representation-abort-portability.d.ts +36 -0
- package/dist/portability/error-representation-abort-portability.d.ts.map +1 -0
- package/dist/portability/error-representation-abort-portability.js +190 -0
- package/dist/portability/error-representation-portability-fixture.d.ts +58 -0
- package/dist/portability/error-representation-portability-fixture.d.ts.map +1 -0
- package/dist/portability/error-representation-portability-fixture.js +202 -0
- package/dist/portability/error-representation-portability.d.ts +50 -0
- package/dist/portability/error-representation-portability.d.ts.map +1 -0
- package/dist/portability/error-representation-portability.js +153 -0
- package/dist/portability/http-adapter-portability.d.ts +24 -1
- package/dist/portability/http-adapter-portability.d.ts.map +1 -1
- package/dist/portability/http-adapter-portability.js +441 -68
- package/dist/portability/response-cookie-portability.d.ts +16 -0
- package/dist/portability/response-cookie-portability.d.ts.map +1 -0
- package/dist/portability/response-cookie-portability.js +81 -0
- package/dist/portability/web-runtime-adapter-portability.d.ts +23 -1
- package/dist/portability/web-runtime-adapter-portability.d.ts.map +1 -1
- package/dist/portability/web-runtime-adapter-portability.js +356 -31
- package/dist/types.d.ts +5 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +19 -15
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { type ContentNegotiationOptions, type ConditionalRequestOptions } from '@fluojs/http';
|
|
1
2
|
import { type ModuleType } from '@fluojs/runtime';
|
|
3
|
+
import { type NetworkHttpErrorRepresentationBootstrapOptions } from './error-representation-portability.js';
|
|
4
|
+
export type { NetworkHttpErrorRepresentationBootstrapOptions } from './error-representation-portability.js';
|
|
2
5
|
type AppLike = {
|
|
3
6
|
close(): Promise<void>;
|
|
4
7
|
listen(): Promise<void>;
|
|
@@ -19,6 +22,15 @@ export interface HttpAdapterPortabilityHarnessOptions<TBootstrapOptions extends
|
|
|
19
22
|
* @returns A promise that resolves to the application instance.
|
|
20
23
|
*/
|
|
21
24
|
bootstrap: (rootModule: ModuleType, options: TBootstrapOptions) => Promise<TApp>;
|
|
25
|
+
/** Adapts the shared error-representation fixture fields to this adapter's bootstrap options. */
|
|
26
|
+
createErrorRepresentationBootstrapOptions?: (options: NetworkHttpErrorRepresentationBootstrapOptions) => TBootstrapOptions;
|
|
27
|
+
/** Adapts shared conditional-request policy options to one listener bootstrap API. */
|
|
28
|
+
createConditionalRequestBootstrapOptions?: (options: {
|
|
29
|
+
readonly conditionalRequest: ConditionalRequestOptions;
|
|
30
|
+
readonly contentNegotiation: ContentNegotiationOptions;
|
|
31
|
+
readonly cors: false;
|
|
32
|
+
readonly port: 0;
|
|
33
|
+
}) => TBootstrapOptions;
|
|
22
34
|
/**
|
|
23
35
|
* Optional adapter-specific content type used by the exact-byte raw-body portability assertion.
|
|
24
36
|
*/
|
|
@@ -56,11 +68,23 @@ export declare class HttpAdapterPortabilityHarness<TBootstrapOptions extends obj
|
|
|
56
68
|
* @param options - Configuration options for the harness.
|
|
57
69
|
*/
|
|
58
70
|
constructor(options: HttpAdapterPortabilityHarnessOptions<TBootstrapOptions, TRunOptions, TApp>);
|
|
71
|
+
/** Verifies JSON, HTML, HEAD, 406, and committed error-response portability. */
|
|
72
|
+
assertSupportsHttpErrorRepresentations(): Promise<void>;
|
|
73
|
+
/** Verifies client-disconnect abort propagation without an HTML or JSON fallback commit. */
|
|
74
|
+
assertDoesNotCommitAbortedHttpErrorRepresentations(): Promise<void>;
|
|
75
|
+
/** Verifies ordered, non-folded portable response cookies over a real listener. */
|
|
76
|
+
assertSupportsPortableResponseCookies(): Promise<void>;
|
|
77
|
+
/** Verifies 304/412 metadata and body suppression through a real network listener. */
|
|
78
|
+
assertSupportsConditionalRequests(): Promise<void>;
|
|
79
|
+
/** Verifies single-byte-range metadata and payload slicing through a real network listener. */
|
|
80
|
+
assertSupportsSingleByteRanges(): Promise<void>;
|
|
59
81
|
/**
|
|
60
82
|
* Asserts that the adapter preserves malformed cookie values without crashing
|
|
61
83
|
* or incorrectly normalizing them.
|
|
62
84
|
*/
|
|
63
85
|
assertPreservesMalformedCookieValues(): Promise<void>;
|
|
86
|
+
/** Verifies `QUERY` and extension-method execution through the adapter's real listener fallback. */
|
|
87
|
+
assertSupportsCustomHttpRouteMethods(): Promise<void>;
|
|
64
88
|
assertPreservesRawBodyForJsonAndText(): Promise<void>;
|
|
65
89
|
assertPreservesExactRawBodyBytesForByteSensitivePayloads(): Promise<void>;
|
|
66
90
|
assertExcludesRawBodyForMultipart(): Promise<void>;
|
|
@@ -88,5 +112,4 @@ export declare class HttpAdapterPortabilityHarness<TBootstrapOptions extends obj
|
|
|
88
112
|
* @returns A new portability harness instance.
|
|
89
113
|
*/
|
|
90
114
|
export declare function createHttpAdapterPortabilityHarness<TBootstrapOptions extends object, TRunOptions extends object, TApp extends AppLike = AppLike>(options: HttpAdapterPortabilityHarnessOptions<TBootstrapOptions, TRunOptions, TApp>): HttpAdapterPortabilityHarness<TBootstrapOptions, TRunOptions, TApp>;
|
|
91
|
-
export {};
|
|
92
115
|
//# sourceMappingURL=http-adapter-portability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-adapter-portability.d.ts","sourceRoot":"","sources":["../../src/portability/http-adapter-portability.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-adapter-portability.d.ts","sourceRoot":"","sources":["../../src/portability/http-adapter-portability.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAM9B,KAAK,yBAAyB,EAI/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAExF,OAAO,EAEL,KAAK,8CAA8C,EACpD,MAAM,uCAAuC,CAAC;AAM/C,YAAY,EAAE,8CAA8C,EAAE,MAAM,uCAAuC,CAAC;AAE5G,KAAK,OAAO,GAAG;IACb,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB,CAAC;AAcF;;;;;;GAMG;AACH,MAAM,WAAW,oCAAoC,CACnD,iBAAiB,SAAS,MAAM,EAChC,WAAW,SAAS,MAAM,EAC1B,IAAI,SAAS,OAAO,GAAG,OAAO;IAE9B;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjF,iGAAiG;IACjG,yCAAyC,CAAC,EAAE,CAC1C,OAAO,EAAE,8CAA8C,KACpD,iBAAiB,CAAC;IAEvB,sFAAsF;IACtF,wCAAwC,CAAC,EAAE,CACzC,OAAO,EAAE;QACP,QAAQ,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;QACvD,QAAQ,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;QACvD,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;QACrB,QAAQ,CAAC,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