@luckystack/test-runner 0.10.2 → 0.11.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/AGENTS.md +7 -0
- package/CHANGELOG.md +7 -0
- package/README.md +13 -68
- package/dist/authEnforcementCheck.d.ts +12 -0
- package/dist/contractCheck.d.ts +24 -0
- package/dist/csrfEnforcementCheck.d.ts +25 -0
- package/dist/customTests.d.ts +145 -0
- package/dist/extensionRegistry.d.ts +83 -0
- package/dist/fuzzCheck.d.ts +12 -0
- package/dist/index.d.ts +49 -745
- package/dist/index.js.map +1 -1
- package/dist/probeRequest.d.ts +48 -0
- package/dist/rateLimitCheck.d.ts +14 -0
- package/dist/reporter.d.ts +3 -0
- package/dist/resetServerState.d.ts +13 -0
- package/dist/resolveTestBaseUrl.d.ts +7 -0
- package/dist/resolveTestEnvironment.d.ts +21 -0
- package/dist/runAllTests.d.ts +88 -0
- package/dist/runAuthEnforcementTests.d.ts +17 -0
- package/dist/runContractTests.d.ts +22 -0
- package/dist/runCsrfEnforcementTests.d.ts +29 -0
- package/dist/runFuzzTests.d.ts +16 -0
- package/dist/runRateLimitTests.d.ts +38 -0
- package/dist/runRegisteredLayers.d.ts +24 -0
- package/dist/sampleInputFor.d.ts +13 -0
- package/dist/schemaSampleInput.d.ts +12 -0
- package/dist/socketProbeTransport.d.ts +9 -0
- package/dist/streamWatcher.d.ts +37 -0
- package/dist/testDataMarker.d.ts +2 -0
- package/dist/testLayerHelpers.d.ts +55 -0
- package/dist/testSocket.d.ts +58 -0
- package/dist/types.d.ts +46 -0
- package/dist/walkEndpoints.d.ts +6 -0
- package/docs/auth-tests.md +4 -223
- package/docs/contract-tests.md +11 -307
- package/docs/extension-hooks.md +4 -467
- package/docs/fuzz-tests.md +4 -245
- package/docs/rate-limit-tests.md +9 -261
- package/package.json +5 -5
- package/CLAUDE.md +0 -117
package/dist/index.d.ts
CHANGED
|
@@ -1,745 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
type
|
|
50
|
-
declare const walkEndpoints: (apiMethodMap: ApiMethodMap) => EndpointDescriptor[];
|
|
51
|
-
type SyncRouteMap = Partial<Record<string, Partial<Record<string, Partial<Record<string, unknown>>>>>>;
|
|
52
|
-
declare const walkSyncEndpoints: (syncMap: SyncMethodMap | SyncMetaMap | SyncRouteMap) => EndpointDescriptor[];
|
|
53
|
-
|
|
54
|
-
interface ProbeRequestInput {
|
|
55
|
-
url: string;
|
|
56
|
-
method: HttpMethod;
|
|
57
|
-
baseUrl: string;
|
|
58
|
-
body?: unknown;
|
|
59
|
-
headers?: Record<string, string>;
|
|
60
|
-
requestTimeoutMs: number;
|
|
61
|
-
}
|
|
62
|
-
interface ProbeResponse {
|
|
63
|
-
/** HTTP status. Absent when the probe travelled over Socket.io. */
|
|
64
|
-
httpStatus?: number;
|
|
65
|
-
parsed: {
|
|
66
|
-
status?: string;
|
|
67
|
-
errorCode?: string;
|
|
68
|
-
} | null;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Send a single timed fetch probe and parse the JSON envelope. Returns
|
|
72
|
-
* `null` when the request itself fails (network error or abort).
|
|
73
|
-
*/
|
|
74
|
-
declare const sendProbe: (input: ProbeRequestInput) => Promise<ProbeResponse | null>;
|
|
75
|
-
interface ProbeTransportRequest {
|
|
76
|
-
endpoint: EndpointDescriptor;
|
|
77
|
-
baseUrl: string;
|
|
78
|
-
/** The route payload — the API `data`, or the sync `data` (the transport adds the sync envelope). */
|
|
79
|
-
body: unknown;
|
|
80
|
-
/** HTTP headers (session Cookie, CSRF). A socket transport reads only the Cookie. */
|
|
81
|
-
headers?: Record<string, string>;
|
|
82
|
-
requestTimeoutMs: number;
|
|
83
|
-
}
|
|
84
|
-
interface ProbeTransport {
|
|
85
|
-
readonly name: 'http' | 'socket';
|
|
86
|
-
/** Resolve with the parsed reply, or `null` when no reply arrived (network error / timeout). */
|
|
87
|
-
send: (request: ProbeTransportRequest) => Promise<ProbeResponse | null>;
|
|
88
|
-
/** Release held connections. Optional — the HTTP transport holds none. */
|
|
89
|
-
close?: () => Promise<void>;
|
|
90
|
-
}
|
|
91
|
-
interface HttpProbeTransportOptions {
|
|
92
|
-
/**
|
|
93
|
-
* Room sent as `receiver` on sync probes. Without one the server answers
|
|
94
|
-
* `sync.missingReceiver`, which proves the envelope but not the route.
|
|
95
|
-
*/
|
|
96
|
-
syncReceiver?: string;
|
|
97
|
-
}
|
|
98
|
-
declare const createHttpProbeTransport: (options?: HttpProbeTransportOptions) => ProbeTransport;
|
|
99
|
-
/** Transport the checks use when the caller supplies none. */
|
|
100
|
-
declare const defaultProbeTransport: ProbeTransport;
|
|
101
|
-
|
|
102
|
-
interface ContractCheckInput {
|
|
103
|
-
endpoint: EndpointDescriptor;
|
|
104
|
-
baseUrl: string;
|
|
105
|
-
/**
|
|
106
|
-
* Optional input factory. Defaults to `{}`. When an endpoint requires a
|
|
107
|
-
* specific shape to not crash, callers can override per-endpoint here.
|
|
108
|
-
*/
|
|
109
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
110
|
-
/**
|
|
111
|
-
* Optional headers (auth tokens, cookies). Applied to every request.
|
|
112
|
-
*/
|
|
113
|
-
headers?: Record<string, string>;
|
|
114
|
-
/**
|
|
115
|
-
* Per-call request timeout in ms. Defaults to 5000. Bump for slow endpoints
|
|
116
|
-
* (AI calls, large reports) where the framework default would false-fail
|
|
117
|
-
* the contract check.
|
|
118
|
-
*/
|
|
119
|
-
requestTimeoutMs?: number;
|
|
120
|
-
/** How the probe reaches the server. Defaults to HTTP. */
|
|
121
|
-
transport?: ProbeTransport;
|
|
122
|
-
}
|
|
123
|
-
declare const runContractCheck: (input: ContractCheckInput) => Promise<ContractCheckResult>;
|
|
124
|
-
|
|
125
|
-
interface RunContractTestsInput {
|
|
126
|
-
apiMethodMap: ApiMethodMap$1;
|
|
127
|
-
/** Generated `syncMetaMap`. When given, sync routes are swept too. */
|
|
128
|
-
syncMetaMap?: SyncMetaMap;
|
|
129
|
-
baseUrl: string;
|
|
130
|
-
/**
|
|
131
|
-
* Endpoints to skip. Matched against `<page>/<name>` (version-agnostic) and
|
|
132
|
-
* `<page>/<name>/<version>` (version-specific). Useful for endpoints that
|
|
133
|
-
* are known to need real input (e.g. a file upload).
|
|
134
|
-
*/
|
|
135
|
-
skip?: string[];
|
|
136
|
-
/** Substring filter on `<page>/<name>/<version>`; other routes are not requested at all. */
|
|
137
|
-
filter?: string;
|
|
138
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
139
|
-
headers?: Record<string, string>;
|
|
140
|
-
/** Transport for sync routes (e.g. the socket transport). API routes always use HTTP. */
|
|
141
|
-
syncTransport?: ProbeTransport;
|
|
142
|
-
onResult?: (result: ContractCheckResult) => void;
|
|
143
|
-
}
|
|
144
|
-
declare const runContractTests: (input: RunContractTestsInput) => Promise<RunContractSummary>;
|
|
145
|
-
|
|
146
|
-
interface AuthEnforcementCheckInput {
|
|
147
|
-
endpoint: EndpointDescriptor;
|
|
148
|
-
baseUrl: string;
|
|
149
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
150
|
-
/** Per-call request timeout in ms. Defaults to 5000. */
|
|
151
|
-
requestTimeoutMs?: number;
|
|
152
|
-
/** How the probe reaches the server. Defaults to HTTP. */
|
|
153
|
-
transport?: ProbeTransport;
|
|
154
|
-
}
|
|
155
|
-
declare const runAuthEnforcementCheck: (input: AuthEnforcementCheckInput) => Promise<ContractCheckResult>;
|
|
156
|
-
|
|
157
|
-
interface RunAuthEnforcementTestsInput {
|
|
158
|
-
apiMethodMap: ApiMethodMap$1;
|
|
159
|
-
apiMetaMap: ApiMetaMap;
|
|
160
|
-
/** Generated `syncMetaMap`. When given, sync routes are swept too. */
|
|
161
|
-
syncMetaMap?: SyncMetaMap;
|
|
162
|
-
baseUrl: string;
|
|
163
|
-
skip?: string[];
|
|
164
|
-
/** Substring filter on `<page>/<name>/<version>`; other routes are not requested at all. */
|
|
165
|
-
filter?: string;
|
|
166
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
167
|
-
/** Transport for sync routes (e.g. the socket transport). API routes always use HTTP. */
|
|
168
|
-
syncTransport?: ProbeTransport;
|
|
169
|
-
onResult?: (result: ContractCheckResult) => void;
|
|
170
|
-
}
|
|
171
|
-
declare const runAuthEnforcementTests: (input: RunAuthEnforcementTestsInput) => Promise<RunContractSummary>;
|
|
172
|
-
|
|
173
|
-
interface RateLimitCheckInput {
|
|
174
|
-
endpoint: EndpointDescriptor;
|
|
175
|
-
baseUrl: string;
|
|
176
|
-
rateLimit: number;
|
|
177
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
178
|
-
headers?: Record<string, string>;
|
|
179
|
-
/** Per-call request timeout in ms. Defaults to 10000. */
|
|
180
|
-
requestTimeoutMs?: number;
|
|
181
|
-
/** How the probes reach the server. Defaults to HTTP. */
|
|
182
|
-
transport?: ProbeTransport;
|
|
183
|
-
}
|
|
184
|
-
declare const runRateLimitCheck: (input: RateLimitCheckInput) => Promise<ContractCheckResult>;
|
|
185
|
-
|
|
186
|
-
interface RunRateLimitTestsInput {
|
|
187
|
-
apiMethodMap: ApiMethodMap$1;
|
|
188
|
-
apiMetaMap: ApiMetaMap;
|
|
189
|
-
/** Generated `syncMetaMap`. When given, sync routes are swept too. */
|
|
190
|
-
syncMetaMap?: SyncMetaMap;
|
|
191
|
-
baseUrl: string;
|
|
192
|
-
skip?: string[];
|
|
193
|
-
/** Substring filter on `<page>/<name>/<version>`; other routes are not requested at all. */
|
|
194
|
-
filter?: string;
|
|
195
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
196
|
-
headers?: Record<string, string>;
|
|
197
|
-
/** Transport for sync routes (e.g. the socket transport). API routes always use HTTP. */
|
|
198
|
-
syncTransport?: ProbeTransport;
|
|
199
|
-
/**
|
|
200
|
-
* Max rateLimit value to test. Endpoints with a higher limit are skipped
|
|
201
|
-
* to avoid firing thousands of requests in CI.
|
|
202
|
-
*/
|
|
203
|
-
maxRateLimitToTest?: number;
|
|
204
|
-
/**
|
|
205
|
-
* When true, hit `/_test/reset?only=rateLimits` before each endpoint so
|
|
206
|
-
* limiter state is clean. Only the limiter buckets are cleared — sessions
|
|
207
|
-
* survive, so an authenticated sweep keeps its session. Requires the server
|
|
208
|
-
* to allow the endpoint: `NODE_ENV` in { 'development', 'test' } AND
|
|
209
|
-
* `TEST_RESET_TOKEN` set on the server with a matching `resetToken` here (an
|
|
210
|
-
* unset token is 403, never open). Without resetting, the shared IP bucket
|
|
211
|
-
* leaks state between endpoints.
|
|
212
|
-
*/
|
|
213
|
-
resetBetweenEndpoints?: boolean;
|
|
214
|
-
/**
|
|
215
|
-
* Token forwarded as `X-Test-Reset-Token` when resetting. Only relevant in
|
|
216
|
-
* staging/preview deploys that enable the endpoint behind a token.
|
|
217
|
-
*/
|
|
218
|
-
resetToken?: string;
|
|
219
|
-
onResult?: (result: ContractCheckResult) => void;
|
|
220
|
-
}
|
|
221
|
-
declare const runRateLimitTests: (input: RunRateLimitTestsInput) => Promise<RunContractSummary>;
|
|
222
|
-
|
|
223
|
-
interface CsrfEnforcementCheckInput {
|
|
224
|
-
endpoint: EndpointDescriptor;
|
|
225
|
-
baseUrl: string;
|
|
226
|
-
/**
|
|
227
|
-
* A valid session Cookie header (`<name>=<token>`). The probe deliberately
|
|
228
|
-
* carries it so the request passes the auth guard and reaches the CSRF check.
|
|
229
|
-
*/
|
|
230
|
-
authCookie: string;
|
|
231
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
232
|
-
/** Per-call request timeout in ms. Defaults to 5000. */
|
|
233
|
-
requestTimeoutMs?: number;
|
|
234
|
-
/** Error code expected on CSRF rejection. Defaults to `auth.csrfMismatch`. */
|
|
235
|
-
expectedErrorCode?: string;
|
|
236
|
-
/** HTTP status expected on CSRF rejection. Defaults to 403; pass `false` to skip. */
|
|
237
|
-
expectedHttpStatus?: number | false;
|
|
238
|
-
/**
|
|
239
|
-
* HTTP transport the probe uses (e.g. one carrying the sync `receiver`).
|
|
240
|
-
* CSRF is an HTTP-only guard, so a non-HTTP transport makes the check skip.
|
|
241
|
-
* Defaults to plain HTTP.
|
|
242
|
-
*/
|
|
243
|
-
transport?: ProbeTransport;
|
|
244
|
-
}
|
|
245
|
-
declare const runCsrfEnforcementCheck: (input: CsrfEnforcementCheckInput) => Promise<ContractCheckResult>;
|
|
246
|
-
|
|
247
|
-
interface RunCsrfEnforcementTestsInput {
|
|
248
|
-
apiMethodMap: ApiMethodMap$1;
|
|
249
|
-
apiMetaMap: ApiMetaMap;
|
|
250
|
-
/** Generated `syncMetaMap`. When given, sync routes' `/sync/*` HTTP endpoints are probed too. */
|
|
251
|
-
syncMetaMap?: SyncMetaMap;
|
|
252
|
-
baseUrl: string;
|
|
253
|
-
/** Valid session Cookie header (`<name>=<token>`) the probes carry so they reach the CSRF check. */
|
|
254
|
-
authCookie: string;
|
|
255
|
-
skip?: string[];
|
|
256
|
-
/** Substring filter on `<page>/<name>/<version>`; other routes are not requested at all. */
|
|
257
|
-
filter?: string;
|
|
258
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
259
|
-
/**
|
|
260
|
-
* HTTP transport for sync routes (one carrying the sync `receiver`). CSRF is
|
|
261
|
-
* an HTTP-only guard, so this must be an HTTP transport even when the project
|
|
262
|
-
* syncs over Socket.io — the `/sync/*` HTTP route is reachable either way.
|
|
263
|
-
*/
|
|
264
|
-
syncTransport?: ProbeTransport;
|
|
265
|
-
/** Per-call request timeout in ms forwarded to each check. */
|
|
266
|
-
requestTimeoutMs?: number;
|
|
267
|
-
/** Error code expected on CSRF rejection. Defaults to `auth.csrfMismatch`. */
|
|
268
|
-
expectedErrorCode?: string;
|
|
269
|
-
/** HTTP status expected on CSRF rejection. Defaults to 403; pass `false` to skip. */
|
|
270
|
-
expectedHttpStatus?: number | false;
|
|
271
|
-
onResult?: (result: ContractCheckResult) => void;
|
|
272
|
-
}
|
|
273
|
-
declare const runCsrfEnforcementTests: (input: RunCsrfEnforcementTestsInput) => Promise<RunContractSummary>;
|
|
274
|
-
|
|
275
|
-
interface FuzzCheckInput {
|
|
276
|
-
endpoint: EndpointDescriptor;
|
|
277
|
-
baseUrl: string;
|
|
278
|
-
headers?: Record<string, string>;
|
|
279
|
-
/** Per-call request timeout in ms. Defaults to 5000. */
|
|
280
|
-
requestTimeoutMs?: number;
|
|
281
|
-
/** How the probes reach the server. Defaults to HTTP. */
|
|
282
|
-
transport?: ProbeTransport;
|
|
283
|
-
}
|
|
284
|
-
declare const runFuzzCheck: (input: FuzzCheckInput) => Promise<ContractCheckResult>;
|
|
285
|
-
|
|
286
|
-
interface RunFuzzTestsInput {
|
|
287
|
-
apiMethodMap: ApiMethodMap$1;
|
|
288
|
-
/** Generated `syncMetaMap`. When given, sync routes are swept too. */
|
|
289
|
-
syncMetaMap?: SyncMetaMap;
|
|
290
|
-
baseUrl: string;
|
|
291
|
-
skip?: string[];
|
|
292
|
-
/** Substring filter on `<page>/<name>/<version>`; other routes are not requested at all. */
|
|
293
|
-
filter?: string;
|
|
294
|
-
headers?: Record<string, string>;
|
|
295
|
-
/** Transport for sync routes (e.g. the socket transport). API routes always use HTTP. */
|
|
296
|
-
syncTransport?: ProbeTransport;
|
|
297
|
-
onResult?: (result: ContractCheckResult) => void;
|
|
298
|
-
}
|
|
299
|
-
declare const runFuzzTests: (input: RunFuzzTestsInput) => Promise<RunContractSummary>;
|
|
300
|
-
|
|
301
|
-
interface ResetServerStateInput {
|
|
302
|
-
baseUrl: string;
|
|
303
|
-
token?: string;
|
|
304
|
-
requestTimeoutMs?: number;
|
|
305
|
-
/**
|
|
306
|
-
* Clear only these targets (`?only=`). Omit for the server's default reset,
|
|
307
|
-
* which ALSO deletes every Redis session — including an authenticated sweep's
|
|
308
|
-
* own. The runner itself always passes `['rateLimits']`.
|
|
309
|
-
*/
|
|
310
|
-
only?: TestResetTarget[];
|
|
311
|
-
}
|
|
312
|
-
declare const resetServerState: ({ baseUrl, token, requestTimeoutMs, only }: ResetServerStateInput) => Promise<boolean>;
|
|
313
|
-
|
|
314
|
-
interface SocketProbeTransportOptions {
|
|
315
|
-
baseUrl: string;
|
|
316
|
-
/** Room every sync probe targets; authenticated sockets join it first. */
|
|
317
|
-
receiver: string;
|
|
318
|
-
/** Session cookie name, used to read the token out of a probe's Cookie header. */
|
|
319
|
-
sessionCookieName: string;
|
|
320
|
-
}
|
|
321
|
-
declare const createSocketProbeTransport: (options: SocketProbeTransportOptions) => ProbeTransport;
|
|
322
|
-
|
|
323
|
-
type InputSchemaMap = Partial<Record<string, Partial<Record<string, Partial<Record<string, ZodType | undefined>>>>>>;
|
|
324
|
-
interface CreateSampleInputForOptions {
|
|
325
|
-
apiInputSchemas?: InputSchemaMap;
|
|
326
|
-
syncInputSchemas?: InputSchemaMap;
|
|
327
|
-
/**
|
|
328
|
-
* Prefix for generated unconstrained strings — pass the run's
|
|
329
|
-
* `createTestDataMarker()` so rows the probes create are identifiable.
|
|
330
|
-
*/
|
|
331
|
-
stringPrefix?: string;
|
|
332
|
-
}
|
|
333
|
-
declare const createSampleInputFor: (options: CreateSampleInputForOptions) => (endpoint: EndpointDescriptor) => unknown;
|
|
334
|
-
|
|
335
|
-
interface ResolveTestBaseUrlOptions {
|
|
336
|
-
/** Project root containing node_modules/.luckystack/dev-server.json. */
|
|
337
|
-
cwd?: string;
|
|
338
|
-
/** Used when no explicit override or valid live advertisement exists. */
|
|
339
|
-
fallbackUrl?: string;
|
|
340
|
-
}
|
|
341
|
-
declare const resolveTestBaseUrl: (options?: ResolveTestBaseUrlOptions) => string;
|
|
342
|
-
|
|
343
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
344
|
-
interface ResolveTestEnvironmentInput {
|
|
345
|
-
/**
|
|
346
|
-
* Loads the consumer's default-exported `config.ts` object after `.env` files
|
|
347
|
-
* are available. Keeping this as a callback avoids hardcoding a consumer path
|
|
348
|
-
* inside the package and keeps `@luckystack/secret-manager` optional.
|
|
349
|
-
*/
|
|
350
|
-
loadProjectConfig?: () => MaybePromise<unknown>;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Load the project's env files and resolve optional secret-manager pointers for
|
|
354
|
-
* the TEST process. Call before importing integration-test modules that touch a
|
|
355
|
-
* database, Redis, or another env-backed SDK.
|
|
356
|
-
*/
|
|
357
|
-
declare const resolveTestEnvironment: (input?: ResolveTestEnvironmentInput) => Promise<void>;
|
|
358
|
-
|
|
359
|
-
interface SampleSchemaOptions {
|
|
360
|
-
/**
|
|
361
|
-
* Marker prefix applied to generated UNCONSTRAINED string values so any rows
|
|
362
|
-
* a sweep creates are identifiable + collision-free (finding #98). Strings
|
|
363
|
-
* that carry a format (email/url/uuid/datetime/…) or a check (min/max/
|
|
364
|
-
* length/regex) are left as-is, since prefixing could break the route's own
|
|
365
|
-
* validation and defeat the contract layer's "valid input" guarantee.
|
|
366
|
-
*/
|
|
367
|
-
stringPrefix?: string;
|
|
368
|
-
}
|
|
369
|
-
declare const sampleSchemaInput: (schema: z.ZodType, options?: SampleSchemaOptions) => unknown;
|
|
370
|
-
|
|
371
|
-
declare const TEST_DATA_PREFIX = "lstest_";
|
|
372
|
-
declare const createTestDataMarker: () => string;
|
|
373
|
-
|
|
374
|
-
declare const logContractResult: (result: ContractCheckResult) => void;
|
|
375
|
-
declare const logContractSummary: (summary: RunContractSummary) => void;
|
|
376
|
-
|
|
377
|
-
interface StreamChunkFrame {
|
|
378
|
-
/** Per-request correlation id stamped by the server. */
|
|
379
|
-
cb?: string;
|
|
380
|
-
/** Full route name (`sync/<page>/<name>/<version>`). */
|
|
381
|
-
fullName?: string;
|
|
382
|
-
/** Always `'stream'` for chunk frames. */
|
|
383
|
-
status?: 'stream';
|
|
384
|
-
/** Payload fields spread on top of the envelope. */
|
|
385
|
-
[key: string]: unknown;
|
|
386
|
-
}
|
|
387
|
-
interface StreamWatcher<TChunk extends StreamChunkFrame = StreamChunkFrame> {
|
|
388
|
-
/** Chunks received so far. Array reference is stable; entries are pushed in arrival order. */
|
|
389
|
-
readonly chunks: TChunk[];
|
|
390
|
-
/** Wait until `predicate(chunks)` returns true, or until timeout (default 5000ms). */
|
|
391
|
-
stopAt(predicate: (chunks: TChunk[]) => boolean, timeoutMs?: number): Promise<void>;
|
|
392
|
-
/** Wait until N total chunks received, or until timeout. */
|
|
393
|
-
waitForCount(n: number, timeoutMs?: number): Promise<void>;
|
|
394
|
-
/** Close socket B. Tests SHOULD call this in cleanup; ctx auto-closes all watchers when the test ends. */
|
|
395
|
-
close(): Promise<void>;
|
|
396
|
-
}
|
|
397
|
-
interface OpenStreamWatcherInput {
|
|
398
|
-
/** Server URL (same as `ctx`'s `baseUrl`). */
|
|
399
|
-
baseUrl: string;
|
|
400
|
-
/** Room to join as a pure subscriber. */
|
|
401
|
-
roomCode: string;
|
|
402
|
-
/** Active session token (used for `joinRoom` auth). May be null for routes that don't require auth. */
|
|
403
|
-
token: string | null;
|
|
404
|
-
/**
|
|
405
|
-
* Resolved route name `sync/<page>/<name>/<version>` — chunk frames are
|
|
406
|
-
* filtered by their `fullName` property so a watcher only surfaces chunks
|
|
407
|
-
* for the route its test is bound to.
|
|
408
|
-
*/
|
|
409
|
-
routeFullName: string;
|
|
410
|
-
/** Default 5000ms — overridable per `stopAt` / `waitForCount` call. */
|
|
411
|
-
defaultTimeoutMs?: number;
|
|
412
|
-
}
|
|
413
|
-
declare const openStreamWatcher: <TChunk extends StreamChunkFrame = StreamChunkFrame>(input: OpenStreamWatcherInput) => Promise<StreamWatcher<TChunk>>;
|
|
414
|
-
|
|
415
|
-
interface CustomTestCase {
|
|
416
|
-
name: string;
|
|
417
|
-
run: (ctx: TestContext) => Promise<void>;
|
|
418
|
-
/**
|
|
419
|
-
* Mark this case as a KNOWN, accepted failure (e.g. a documented bug not
|
|
420
|
-
* yet fixed, or a scenario the current implementation cannot satisfy). The
|
|
421
|
-
* string is the reason shown in the report. A case marked `expectedToFail`
|
|
422
|
-
* that throws is reported as `xfail` — counted separately, NOT a red
|
|
423
|
-
* failure. If it unexpectedly PASSES it is reported as `xpass` so the stale
|
|
424
|
-
* marker can be removed. Leave undefined for normal cases.
|
|
425
|
-
*/
|
|
426
|
-
expectedToFail?: string;
|
|
427
|
-
}
|
|
428
|
-
interface CustomTestResult {
|
|
429
|
-
routePath: string;
|
|
430
|
-
caseName: string;
|
|
431
|
-
status: 'pass' | 'fail' | 'xfail' | 'xpass';
|
|
432
|
-
durationMs: number;
|
|
433
|
-
reason?: string;
|
|
434
|
-
/** Documented reason when the case carried an `expectedToFail` marker. */
|
|
435
|
-
expectedToFail?: string;
|
|
436
|
-
}
|
|
437
|
-
interface RunCustomTestsSummary {
|
|
438
|
-
total: number;
|
|
439
|
-
passed: number;
|
|
440
|
-
failed: number;
|
|
441
|
-
/** Cases marked `expectedToFail` that failed as expected (known issues). */
|
|
442
|
-
xfailed: number;
|
|
443
|
-
/** Cases marked `expectedToFail` that unexpectedly passed (remove the marker). */
|
|
444
|
-
xpassed: number;
|
|
445
|
-
results: CustomTestResult[];
|
|
446
|
-
}
|
|
447
|
-
interface RunCustomTestsInput {
|
|
448
|
-
baseUrl: string;
|
|
449
|
-
/** Optional cookie name for the session token. Defaults to the project's configured cookie. */
|
|
450
|
-
sessionCookieName?: string;
|
|
451
|
-
/** Filter to a subset of routes — substring match against `<page>/<name>/<version>`. */
|
|
452
|
-
filter?: string;
|
|
453
|
-
/**
|
|
454
|
-
* Generated `apiMethodMap` so the harness sends each API route its declared
|
|
455
|
-
* HTTP method (e.g. logout is DELETE). Falls back to POST when absent.
|
|
456
|
-
*/
|
|
457
|
-
apiMethodMap?: ApiMethodMap$1;
|
|
458
|
-
/**
|
|
459
|
-
* Lazy consumer config for direct Layer-5 runs. Required so the public path
|
|
460
|
-
* cannot silently skip a configured secret manager; `runAllTests` prepares
|
|
461
|
-
* the environment separately before using the internal Layer-5 entrypoint.
|
|
462
|
-
*/
|
|
463
|
-
loadProjectConfig: NonNullable<ResolveTestEnvironmentInput['loadProjectConfig']>;
|
|
464
|
-
onResult?: (result: CustomTestResult) => void;
|
|
465
|
-
}
|
|
466
|
-
interface DiscoveredTestFile {
|
|
467
|
-
/** Absolute path to the test file. */
|
|
468
|
-
filePath: string;
|
|
469
|
-
/** `api` or `sync` — which transport this route uses. */
|
|
470
|
-
kind: 'api' | 'sync';
|
|
471
|
-
/** Route descriptor parsed from the filename + directory location. */
|
|
472
|
-
route: {
|
|
473
|
-
page: string;
|
|
474
|
-
name: string;
|
|
475
|
-
version: string;
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
declare const discoverCustomTestFiles: (srcDir?: string) => DiscoveredTestFile[];
|
|
479
|
-
interface CallSyncOptions {
|
|
480
|
-
/** Room the sync targets (the server requires one). */
|
|
481
|
-
receiver?: string;
|
|
482
|
-
/** Skip the sender's own socket in the fan-out (socket transport). */
|
|
483
|
-
ignoreSelf?: boolean;
|
|
484
|
-
/** Force a transport. Defaults to the project's `transport.invocation`. */
|
|
485
|
-
transport?: 'socket' | 'http';
|
|
486
|
-
/** Socket transport: join `receiver` before sending. Default `true`. */
|
|
487
|
-
joinRoom?: boolean;
|
|
488
|
-
}
|
|
489
|
-
interface TestContext {
|
|
490
|
-
/**
|
|
491
|
-
* Invoke the route under test. Page / name / version are baked in.
|
|
492
|
-
*
|
|
493
|
-
* `input` travels exactly like the real client sends it: as the JSON body
|
|
494
|
-
* for POST / PUT / DELETE routes, and as the `__luckystack_data` query-string
|
|
495
|
-
* value for GET routes (a GET cannot carry a body). Either way the server
|
|
496
|
-
* validates it as the route's `data`, so a GET route with required fields
|
|
497
|
-
* receives them.
|
|
498
|
-
*/
|
|
499
|
-
callApi: <TInput = unknown, TOutput = unknown>(input: TInput) => Promise<TOutput>;
|
|
500
|
-
/**
|
|
501
|
-
* Invoke the sync route under test over the SAME transport the project's
|
|
502
|
-
* real client uses (`transport.invocation`): Socket.io for `'socket'` (the
|
|
503
|
-
* default), the `/sync/*` HTTP route for `'routed-http'`. Override per call
|
|
504
|
-
* with `opts.transport`. Over the socket, the case's session socket first
|
|
505
|
-
* joins `opts.receiver` (like a real client joins its room before syncing);
|
|
506
|
-
* pass `joinRoom: false` to test a non-member.
|
|
507
|
-
*/
|
|
508
|
-
callSync: <TInput = unknown, TOutput = unknown>(input: TInput, opts?: CallSyncOptions) => Promise<TOutput>;
|
|
509
|
-
/**
|
|
510
|
-
* Open a second socket connection that joins `roomCode` as a pure
|
|
511
|
-
* subscriber and exposes the incoming chunk stream for assertions.
|
|
512
|
-
*
|
|
513
|
-
* The route is auto-derived from the test file location, so a watcher
|
|
514
|
-
* only surfaces chunks for the route this test belongs to. Multiple
|
|
515
|
-
* watchers per test are allowed; all are auto-closed when the test
|
|
516
|
-
* case finishes (whether it passes or throws).
|
|
517
|
-
*/
|
|
518
|
-
watchStream: <TChunk extends StreamChunkFrame = StreamChunkFrame>(roomCode: string) => Promise<StreamWatcher<TChunk>>;
|
|
519
|
-
session: {
|
|
520
|
-
login: (user?: {
|
|
521
|
-
email?: string;
|
|
522
|
-
id?: string;
|
|
523
|
-
name?: string;
|
|
524
|
-
}) => Promise<{
|
|
525
|
-
token: string;
|
|
526
|
-
userId: string;
|
|
527
|
-
}>;
|
|
528
|
-
logout: () => Promise<void>;
|
|
529
|
-
current: () => {
|
|
530
|
-
token: string | null;
|
|
531
|
-
userId: string | null;
|
|
532
|
-
};
|
|
533
|
-
};
|
|
534
|
-
prisma: ReturnType<typeof getPrismaClient>;
|
|
535
|
-
expect: TestExpect;
|
|
536
|
-
}
|
|
537
|
-
interface TestExpect {
|
|
538
|
-
eq: <T>(actual: T, expected: T, message?: string) => void;
|
|
539
|
-
ok: (value: unknown, message?: string) => void;
|
|
540
|
-
throws: (fn: () => Promise<unknown>, message?: string) => Promise<Error>;
|
|
541
|
-
matches: (value: string, pattern: RegExp, message?: string) => void;
|
|
542
|
-
}
|
|
543
|
-
declare const runCustomTests: (input: RunCustomTestsInput) => Promise<RunCustomTestsSummary>;
|
|
544
|
-
|
|
545
|
-
interface RunAllTestsInput {
|
|
546
|
-
apiMethodMap: ApiMethodMap$1;
|
|
547
|
-
/**
|
|
548
|
-
* Generated `syncMetaMap` (from `apiTypes.generated.ts`). When given, the
|
|
549
|
-
* sweep layers exercise every sync route too; without it sync routes are
|
|
550
|
-
* not swept (a warning says so).
|
|
551
|
-
*/
|
|
552
|
-
syncMetaMap?: SyncMetaMap;
|
|
553
|
-
/** Generated `syncInputSchemas` (from `apiInputSchemas.generated.ts`) — Zod-valid sync sample payloads. */
|
|
554
|
-
syncInputSchemas?: InputSchemaMap;
|
|
555
|
-
/**
|
|
556
|
-
* How sync routes are probed. Defaults to the project's own
|
|
557
|
-
* `transport.invocation`: `'socket'` → Socket.io (the pipeline real clients
|
|
558
|
-
* hit), `'routed-http'` → the `/sync/*` HTTP route. The CSRF layer always
|
|
559
|
-
* probes over HTTP — CSRF is an HTTP-only guard.
|
|
560
|
-
*/
|
|
561
|
-
syncTransport?: 'socket' | 'http';
|
|
562
|
-
/**
|
|
563
|
-
* Write the full `RunAllTestsSummary` as JSON to this path (relative to the
|
|
564
|
-
* process cwd). Defaults to `TEST_OUTPUT_FILE`, else `test-results.json`;
|
|
565
|
-
* `false` disables the file.
|
|
566
|
-
*/
|
|
567
|
-
outputFile?: string | false;
|
|
568
|
-
/**
|
|
569
|
-
* Lazy loader for the consumer's default `config.ts` export. Required so
|
|
570
|
-
* runAllTests cannot silently skip a configured secret manager; resolution
|
|
571
|
-
* happens in THIS process before any layer or env-backed client is touched.
|
|
572
|
-
*/
|
|
573
|
-
loadProjectConfig: NonNullable<ResolveTestEnvironmentInput['loadProjectConfig']>;
|
|
574
|
-
apiMetaMap: ApiMetaMap;
|
|
575
|
-
apiInputSchemas: InputSchemaMap;
|
|
576
|
-
baseUrl: string;
|
|
577
|
-
/** Cookie name for the session token. Defaults to the project's configured session cookie name (`projectConfig.http.sessionCookieName`). */
|
|
578
|
-
sessionCookieName?: string;
|
|
579
|
-
/** Auth token applied as a `Cookie` header to sweep-layer requests that need a session. */
|
|
580
|
-
authToken?: string;
|
|
581
|
-
/** Endpoints to skip from the sweep layers, e.g. routes that need a file upload. */
|
|
582
|
-
skip?: string[];
|
|
583
|
-
/** Substring filter applied to `<page>/<name>/<version>`. */
|
|
584
|
-
filter?: string;
|
|
585
|
-
/** Disable individual layers (faster local iteration). */
|
|
586
|
-
noSweep?: boolean;
|
|
587
|
-
noFuzz?: boolean;
|
|
588
|
-
noRateLimit?: boolean;
|
|
589
|
-
/**
|
|
590
|
-
* Disable the CSRF-enforcement layer. Defaults to ON (the layer runs) — but it
|
|
591
|
-
* can only probe past the auth guard with a session, so it is a no-op unless an
|
|
592
|
-
* `authToken` is supplied.
|
|
593
|
-
*/
|
|
594
|
-
noCsrf?: boolean;
|
|
595
|
-
noCustom?: boolean;
|
|
596
|
-
/**
|
|
597
|
-
* Token sent as `X-Test-Reset-Token` when the rate-limit layer resets the
|
|
598
|
-
* shared bucket between endpoints. The server's `/_test/reset` requires
|
|
599
|
-
* `TEST_RESET_TOKEN` to be set and matching — an unset/wrong token is 403, so
|
|
600
|
-
* `resetBetweenEndpoints` would silently no-op. Defaults to
|
|
601
|
-
* `process.env.TEST_RESET_TOKEN` so a CI run with the env set works with no
|
|
602
|
-
* extra wiring; pass explicitly to override.
|
|
603
|
-
*/
|
|
604
|
-
resetToken?: string;
|
|
605
|
-
/**
|
|
606
|
-
* When a reset token is available, the sweep POSTs
|
|
607
|
-
* `/_test/reset?only=rateLimits` ONCE before the first layer (no bucket left
|
|
608
|
-
* drained by an earlier run) and ONCE after the last (the custom layer and the
|
|
609
|
-
* next run start unthrottled). Only limiter state is cleared: sessions — the
|
|
610
|
-
* `authToken` session above all — survive, so `TEST_RESET_TOKEN` can be set
|
|
611
|
-
* on an authenticated sweep. The reset never touches the app database.
|
|
612
|
-
* Defaults to ON; set `false` to opt out. With no token the bookends are
|
|
613
|
-
* skipped with a logged note (they can't run — `/_test/reset` 403s).
|
|
614
|
-
*/
|
|
615
|
-
resetBookends?: boolean;
|
|
616
|
-
}
|
|
617
|
-
interface RunAllTestsSummary {
|
|
618
|
-
contract?: RunContractSummary;
|
|
619
|
-
auth?: RunContractSummary;
|
|
620
|
-
rateLimit?: RunContractSummary;
|
|
621
|
-
csrf?: RunContractSummary;
|
|
622
|
-
fuzz?: RunContractSummary;
|
|
623
|
-
custom?: RunCustomTestsSummary;
|
|
624
|
-
totalPassed: number;
|
|
625
|
-
totalFailed: number;
|
|
626
|
-
}
|
|
627
|
-
declare const runAllTests: (input: RunAllTestsInput) => Promise<RunAllTestsSummary>;
|
|
628
|
-
declare const logRunAllSummary: (summary: RunAllTestsSummary) => void;
|
|
629
|
-
|
|
630
|
-
interface TestLayerInput {
|
|
631
|
-
/** Resolved route name (`api/billing/getInvoice/v1` or `sync/chat/send/v1`). */
|
|
632
|
-
endpoint: string;
|
|
633
|
-
/** Method when applicable, undefined for sync endpoints. */
|
|
634
|
-
method?: string;
|
|
635
|
-
/** Bearer token / session token to use for auth-aware checks. */
|
|
636
|
-
authToken?: string;
|
|
637
|
-
/**
|
|
638
|
-
* A Zod-valid sample `data` payload for this route — generated from the
|
|
639
|
-
* route's input schema when `runRegisteredLayers` received the generated
|
|
640
|
-
* schemas (or an `inputFor`), `{}` otherwise. The same payload the built-in
|
|
641
|
-
* contract sweep sends, so a layer can exercise the route past validation.
|
|
642
|
-
*/
|
|
643
|
-
sampleInput?: unknown;
|
|
644
|
-
}
|
|
645
|
-
interface TestLayerResult {
|
|
646
|
-
passed: boolean;
|
|
647
|
-
/** Short reason key — i18n-style errorCode when failed. */
|
|
648
|
-
message?: string;
|
|
649
|
-
/** Optional extras for the reporter (latency, response sample, ...). */
|
|
650
|
-
metadata?: Record<string, unknown>;
|
|
651
|
-
}
|
|
652
|
-
interface TestLayer {
|
|
653
|
-
name: string;
|
|
654
|
-
run: (input: TestLayerInput) => Promise<TestLayerResult> | TestLayerResult;
|
|
655
|
-
}
|
|
656
|
-
interface TestFixture<TPayload = unknown> {
|
|
657
|
-
valid: TPayload[];
|
|
658
|
-
invalid: TPayload[];
|
|
659
|
-
}
|
|
660
|
-
interface TestResult {
|
|
661
|
-
layer: string;
|
|
662
|
-
endpoint: string;
|
|
663
|
-
passed: boolean;
|
|
664
|
-
message?: string;
|
|
665
|
-
durationMs?: number;
|
|
666
|
-
metadata?: Record<string, unknown>;
|
|
667
|
-
}
|
|
668
|
-
interface TestSummary {
|
|
669
|
-
totalLayers: number;
|
|
670
|
-
totalEndpoints: number;
|
|
671
|
-
passed: number;
|
|
672
|
-
failed: number;
|
|
673
|
-
results: TestResult[];
|
|
674
|
-
}
|
|
675
|
-
interface TestReporter {
|
|
676
|
-
/** Called once per individual TestResult as the runner progresses. */
|
|
677
|
-
onResult?: (result: TestResult) => void | Promise<void>;
|
|
678
|
-
/** Called once at the end with the aggregated summary. */
|
|
679
|
-
onSummary?: (summary: TestSummary) => void | Promise<void>;
|
|
680
|
-
/** Optional webhook the runner POSTs the summary to. */
|
|
681
|
-
webhookUrl?: string;
|
|
682
|
-
webhookAuth?: {
|
|
683
|
-
type: 'bearer';
|
|
684
|
-
token: string;
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Register a custom test layer. Re-registering the same name replaces
|
|
689
|
-
* the previous entry. Use for CORS enforcement, business-rule checks,
|
|
690
|
-
* custom auth schemes, multi-tenant isolation, GDPR data-flow checks.
|
|
691
|
-
*/
|
|
692
|
-
declare const registerTestLayer: (layer: TestLayer) => void;
|
|
693
|
-
declare const listTestLayers: () => TestLayer[];
|
|
694
|
-
/**
|
|
695
|
-
* Register a realistic payload fixture for a specific type key. The fuzz
|
|
696
|
-
* layer prefers these over schema-random generated inputs when a fixture
|
|
697
|
-
* exists for the endpoint's input type.
|
|
698
|
-
*
|
|
699
|
-
* `valid` payloads are used to verify happy-path behavior; `invalid`
|
|
700
|
-
* payloads probe the validator's error responses.
|
|
701
|
-
*/
|
|
702
|
-
declare const registerTestFixture: <TPayload = unknown>(typeKey: string, fixture: TestFixture<TPayload>) => void;
|
|
703
|
-
declare const getTestFixture: (typeKey: string) => TestFixture | undefined;
|
|
704
|
-
/**
|
|
705
|
-
* Register a test reporter. Set `null` to unregister. The runner calls
|
|
706
|
-
* `onResult` per individual result as the run progresses and `onSummary`
|
|
707
|
-
* once at the end. When `webhookUrl` is set, the runner additionally
|
|
708
|
-
* POSTs the JSON-serialised summary to that URL.
|
|
709
|
-
*/
|
|
710
|
-
declare const registerTestReporter: (newReporter: TestReporter | null) => void;
|
|
711
|
-
declare const getTestReporter: () => TestReporter | null;
|
|
712
|
-
declare const resetTestExtensionsForTests: () => void;
|
|
713
|
-
|
|
714
|
-
interface RunRegisteredLayersInput {
|
|
715
|
-
apiMethodMap: ApiMethodMap$1;
|
|
716
|
-
/** Generated `syncMetaMap`. When given, layers also run against every sync route. */
|
|
717
|
-
syncMetaMap?: SyncMetaMap;
|
|
718
|
-
/** Session/bearer token forwarded to each layer's `run({ authToken })`. */
|
|
719
|
-
authToken?: string;
|
|
720
|
-
/**
|
|
721
|
-
* Endpoints to skip — matched against `<page>/<name>` (version-agnostic) and
|
|
722
|
-
* `<page>/<name>/<version>`, same convention as the built-in sweeps.
|
|
723
|
-
*/
|
|
724
|
-
skip?: string[];
|
|
725
|
-
/** Substring filter on `<page>/<name>/<version>`, same as the built-in sweeps. */
|
|
726
|
-
filter?: string;
|
|
727
|
-
/** Generated `apiInputSchemas` — source of each API route's `sampleInput`. */
|
|
728
|
-
apiInputSchemas?: InputSchemaMap;
|
|
729
|
-
/** Generated `syncInputSchemas` — source of each sync route's `sampleInput`. */
|
|
730
|
-
syncInputSchemas?: InputSchemaMap;
|
|
731
|
-
/** Custom sample factory; wins over the schema maps when given. */
|
|
732
|
-
inputFor?: (endpoint: EndpointDescriptor) => unknown;
|
|
733
|
-
}
|
|
734
|
-
declare const runRegisteredLayers: (input: RunRegisteredLayersInput) => Promise<TestSummary>;
|
|
735
|
-
|
|
736
|
-
declare const LAYER_KEYS: {
|
|
737
|
-
readonly contract: "contract";
|
|
738
|
-
readonly auth: "auth-enforcement";
|
|
739
|
-
readonly rateLimit: "rate-limit";
|
|
740
|
-
readonly csrf: "csrf-enforcement";
|
|
741
|
-
readonly fuzz: "fuzz";
|
|
742
|
-
readonly custom: "custom";
|
|
743
|
-
};
|
|
744
|
-
|
|
745
|
-
export { type ApiMetaEntry, type ApiMetaMap, type ApiMethodMap$1 as ApiMethodMap, type AuthEnforcementCheckInput, type CallSyncOptions, type ContractCheckInput, type ContractCheckResult, type CreateSampleInputForOptions, type CsrfEnforcementCheckInput, type CustomTestCase, type CustomTestResult, type EndpointDescriptor, type FuzzCheckInput, type HttpMethod, type HttpProbeTransportOptions, type InputSchemaMap, LAYER_KEYS, type OpenStreamWatcherInput, type ProbeRequestInput, type ProbeResponse, type ProbeTransport, type ProbeTransportRequest, type RateLimitCheckInput, type ResetServerStateInput, type ResolveTestBaseUrlOptions, type ResolveTestEnvironmentInput, type RunAllTestsInput, type RunAllTestsSummary, type RunAuthEnforcementTestsInput, type RunContractSummary, type RunContractTestsInput, type RunCsrfEnforcementTestsInput, type RunCustomTestsInput, type RunCustomTestsSummary, type RunFuzzTestsInput, type RunRateLimitTestsInput, type RunRegisteredLayersInput, type SampleSchemaOptions, type SocketProbeTransportOptions, type StreamChunkFrame, type StreamWatcher, type SyncMetaEntry, type SyncMetaMap, type SyncMethodMap, TEST_DATA_PREFIX, type TestContext, type TestExpect, type TestFixture, type TestLayer, type TestLayerInput, type TestLayerResult, type TestReporter, type TestResult, type TestSummary, createHttpProbeTransport, createSampleInputFor, createSocketProbeTransport, createTestDataMarker, defaultProbeTransport, discoverCustomTestFiles, getTestFixture, getTestReporter, listTestLayers, logContractResult, logContractSummary, logRunAllSummary, openStreamWatcher, registerTestFixture, registerTestLayer, registerTestReporter, resetServerState, resetTestExtensionsForTests, resolveTestBaseUrl, resolveTestEnvironment, runAllTests, runAuthEnforcementCheck, runAuthEnforcementTests, runContractCheck, runContractTests, runCsrfEnforcementCheck, runCsrfEnforcementTests, runCustomTests, runFuzzCheck, runFuzzTests, runRateLimitCheck, runRateLimitTests, runRegisteredLayers, sampleSchemaInput, sendProbe, walkEndpoints, walkSyncEndpoints };
|
|
1
|
+
export { walkEndpoints, walkSyncEndpoints } from './walkEndpoints.js';
|
|
2
|
+
export { runContractCheck } from './contractCheck.js';
|
|
3
|
+
export { runContractTests } from './runContractTests.js';
|
|
4
|
+
export { runAuthEnforcementCheck } from './authEnforcementCheck.js';
|
|
5
|
+
export { runAuthEnforcementTests } from './runAuthEnforcementTests.js';
|
|
6
|
+
export { runRateLimitCheck } from './rateLimitCheck.js';
|
|
7
|
+
export { runRateLimitTests } from './runRateLimitTests.js';
|
|
8
|
+
export { runCsrfEnforcementCheck } from './csrfEnforcementCheck.js';
|
|
9
|
+
export { runCsrfEnforcementTests } from './runCsrfEnforcementTests.js';
|
|
10
|
+
export { runFuzzCheck } from './fuzzCheck.js';
|
|
11
|
+
export { runFuzzTests } from './runFuzzTests.js';
|
|
12
|
+
export { resetServerState } from './resetServerState.js';
|
|
13
|
+
export { sendProbe, createHttpProbeTransport, defaultProbeTransport } from './probeRequest.js';
|
|
14
|
+
export type { ProbeRequestInput, ProbeResponse, ProbeTransport, ProbeTransportRequest, HttpProbeTransportOptions, } from './probeRequest.js';
|
|
15
|
+
export { createSocketProbeTransport } from './socketProbeTransport.js';
|
|
16
|
+
export type { SocketProbeTransportOptions } from './socketProbeTransport.js';
|
|
17
|
+
export { createSampleInputFor } from './sampleInputFor.js';
|
|
18
|
+
export type { CreateSampleInputForOptions, InputSchemaMap } from './sampleInputFor.js';
|
|
19
|
+
export { resolveTestBaseUrl } from './resolveTestBaseUrl.js';
|
|
20
|
+
export type { ResolveTestBaseUrlOptions } from './resolveTestBaseUrl.js';
|
|
21
|
+
export { resolveTestEnvironment } from './resolveTestEnvironment.js';
|
|
22
|
+
export type { ResolveTestEnvironmentInput } from './resolveTestEnvironment.js';
|
|
23
|
+
export { sampleSchemaInput } from './schemaSampleInput.js';
|
|
24
|
+
export type { SampleSchemaOptions } from './schemaSampleInput.js';
|
|
25
|
+
export { TEST_DATA_PREFIX, createTestDataMarker } from './testDataMarker.js';
|
|
26
|
+
export { logContractResult, logContractSummary } from './reporter.js';
|
|
27
|
+
export type { EndpointDescriptor, HttpMethod, ContractCheckResult, RunContractSummary, SyncMethodMap, SyncMetaMap, SyncMetaEntry, ApiMethodMap, ApiMetaMap, ApiMetaEntry, } from './types.js';
|
|
28
|
+
export type { RunContractTestsInput } from './runContractTests.js';
|
|
29
|
+
export type { ContractCheckInput } from './contractCheck.js';
|
|
30
|
+
export type { AuthEnforcementCheckInput } from './authEnforcementCheck.js';
|
|
31
|
+
export type { RunAuthEnforcementTestsInput } from './runAuthEnforcementTests.js';
|
|
32
|
+
export type { RateLimitCheckInput } from './rateLimitCheck.js';
|
|
33
|
+
export type { RunRateLimitTestsInput } from './runRateLimitTests.js';
|
|
34
|
+
export type { CsrfEnforcementCheckInput } from './csrfEnforcementCheck.js';
|
|
35
|
+
export type { RunCsrfEnforcementTestsInput } from './runCsrfEnforcementTests.js';
|
|
36
|
+
export type { FuzzCheckInput } from './fuzzCheck.js';
|
|
37
|
+
export type { RunFuzzTestsInput } from './runFuzzTests.js';
|
|
38
|
+
export type { ResetServerStateInput } from './resetServerState.js';
|
|
39
|
+
export { runCustomTests, discoverCustomTestFiles, } from './customTests.js';
|
|
40
|
+
export type { CustomTestCase, CallSyncOptions, TestContext, TestExpect, CustomTestResult, RunCustomTestsInput, RunCustomTestsSummary, } from './customTests.js';
|
|
41
|
+
export { openStreamWatcher } from './streamWatcher.js';
|
|
42
|
+
export type { StreamWatcher, StreamChunkFrame, OpenStreamWatcherInput, } from './streamWatcher.js';
|
|
43
|
+
export { runAllTests, logRunAllSummary } from './runAllTests.js';
|
|
44
|
+
export type { RunAllTestsInput, RunAllTestsSummary } from './runAllTests.js';
|
|
45
|
+
export { registerTestLayer, listTestLayers, registerTestFixture, getTestFixture, registerTestReporter, getTestReporter, resetTestExtensionsForTests, } from './extensionRegistry.js';
|
|
46
|
+
export { runRegisteredLayers } from './runRegisteredLayers.js';
|
|
47
|
+
export type { RunRegisteredLayersInput } from './runRegisteredLayers.js';
|
|
48
|
+
export { LAYER_KEYS } from './testLayerHelpers.js';
|
|
49
|
+
export type { TestLayer, TestLayerInput, TestLayerResult, TestFixture, TestResult, TestSummary, TestReporter, } from './extensionRegistry.js';
|