@ripplo/testing 0.6.1 → 0.7.1
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/DSL.md +357 -0
- package/LICENSE.md +1 -0
- package/README.md +47 -273
- package/dist/engine-BfvzXgLg.d.ts +1091 -0
- package/dist/express.d.ts +7 -9
- package/dist/express.js +422 -48
- package/dist/index.d.ts +134 -59
- package/dist/index.js +1654 -1126
- package/package.json +31 -113
- package/dist/actions.d.ts +0 -260
- package/dist/actions.js +0 -177
- package/dist/assert.d.ts +0 -188
- package/dist/assert.js +0 -111
- package/dist/builder-SsgqYqSC.d.ts +0 -156
- package/dist/chunk-2YLI7VD4.js +0 -65
- package/dist/chunk-4MGIQFAJ.js +0 -16
- package/dist/chunk-DCJBLS2U.js +0 -26
- package/dist/chunk-MGATMMCZ.js +0 -16
- package/dist/chunk-XO36IU66.js +0 -88
- package/dist/chunk-YFOTJIVF.js +0 -134
- package/dist/chunk-YQAEOH5W.js +0 -111
- package/dist/compiler.d.ts +0 -32
- package/dist/compiler.js +0 -8
- package/dist/control.d.ts +0 -45
- package/dist/control.js +0 -17
- package/dist/elysia.d.ts +0 -78
- package/dist/elysia.js +0 -114
- package/dist/engine-BOqzK_go.d.ts +0 -61
- package/dist/fastify.d.ts +0 -14
- package/dist/fastify.js +0 -79
- package/dist/hono.d.ts +0 -19
- package/dist/hono.js +0 -89
- package/dist/koa.d.ts +0 -14
- package/dist/koa.js +0 -135
- package/dist/locators.d.ts +0 -40
- package/dist/locators.js +0 -11
- package/dist/lockfile.d.ts +0 -722
- package/dist/lockfile.js +0 -707
- package/dist/nestjs.d.ts +0 -17
- package/dist/nestjs.js +0 -139
- package/dist/nextjs.d.ts +0 -14
- package/dist/nextjs.js +0 -137
- package/dist/step-De52hTLd.d.ts +0 -19
- package/dist/types-BzZrl65Z.d.ts +0 -115
package/dist/nestjs.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { R as RipploEngine } from './engine-BOqzK_go.js';
|
|
3
|
-
import './builder-SsgqYqSC.js';
|
|
4
|
-
import './types-BzZrl65Z.js';
|
|
5
|
-
import './step-De52hTLd.js';
|
|
6
|
-
import '@ripplo/spec';
|
|
7
|
-
|
|
8
|
-
interface RipploTestingModuleOptions {
|
|
9
|
-
readonly enabled: boolean;
|
|
10
|
-
readonly engine: RipploEngine;
|
|
11
|
-
readonly path: string | undefined;
|
|
12
|
-
}
|
|
13
|
-
declare class RipploTestingModule {
|
|
14
|
-
static forRoot(options: RipploTestingModuleOptions): DynamicModule;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { RipploTestingModule, type RipploTestingModuleOptions };
|
package/dist/nestjs.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
batchRequestSchema,
|
|
3
|
-
observerRequestSchema,
|
|
4
|
-
readAdapterWebhookSecret,
|
|
5
|
-
teardownRequestSchema,
|
|
6
|
-
toBatchRunResults,
|
|
7
|
-
toTeardownResults,
|
|
8
|
-
verifyWebhookSignature
|
|
9
|
-
} from "./chunk-XO36IU66.js";
|
|
10
|
-
import {
|
|
11
|
-
__decorateClass,
|
|
12
|
-
__decorateParam
|
|
13
|
-
} from "./chunk-4MGIQFAJ.js";
|
|
14
|
-
|
|
15
|
-
// src/adapters/nestjs.ts
|
|
16
|
-
import { Controller, Inject, Module, Put, Req, Res } from "@nestjs/common";
|
|
17
|
-
var RIPPLO_OPTIONS = "RIPPLO_TESTING_OPTIONS";
|
|
18
|
-
var RipploTestingModule = class {
|
|
19
|
-
static forRoot(options) {
|
|
20
|
-
const path = options.path ?? "ripplo";
|
|
21
|
-
const controller = createController(path);
|
|
22
|
-
return {
|
|
23
|
-
controllers: [controller],
|
|
24
|
-
module: RipploTestingModule,
|
|
25
|
-
providers: [
|
|
26
|
-
{
|
|
27
|
-
provide: RIPPLO_OPTIONS,
|
|
28
|
-
useValue: { enabled: options.enabled, engine: options.engine }
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
RipploTestingModule = __decorateClass([
|
|
35
|
-
Module({})
|
|
36
|
-
], RipploTestingModule);
|
|
37
|
-
function createController(path) {
|
|
38
|
-
let RipploController = class {
|
|
39
|
-
constructor(opts) {
|
|
40
|
-
this.opts = opts;
|
|
41
|
-
}
|
|
42
|
-
async executePreconditions(req, res) {
|
|
43
|
-
if (!guard(req, res, this.opts)) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const parsed = batchRequestSchema.safeParse(req.body);
|
|
47
|
-
if (!parsed.success) {
|
|
48
|
-
res.status(400).json({ error: "Invalid request body" });
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const host = req.get("host") ?? "";
|
|
52
|
-
const proto = req.get("x-forwarded-proto") ?? req.protocol;
|
|
53
|
-
const appUrl = `${proto}://${host}`;
|
|
54
|
-
const items = parsed.data.batch.map((b) => ({ names: b.preconditions, runId: b.runId }));
|
|
55
|
-
const results = await this.opts.engine.executePreconditions(items, { appUrl });
|
|
56
|
-
res.status(200).json({ results: toBatchRunResults(results) });
|
|
57
|
-
}
|
|
58
|
-
async executeObserver(req, res) {
|
|
59
|
-
if (!guard(req, res, this.opts)) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const parsed = observerRequestSchema.safeParse(req.body);
|
|
63
|
-
if (!parsed.success) {
|
|
64
|
-
res.status(400).json({ error: "Invalid request body", success: false });
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const result = await this.opts.engine.executeObserver(
|
|
68
|
-
parsed.data.observer,
|
|
69
|
-
parsed.data.params
|
|
70
|
-
);
|
|
71
|
-
res.status(200).json({ error: result.error, outcome: result.outcome, success: result.success });
|
|
72
|
-
}
|
|
73
|
-
async teardown(req, res) {
|
|
74
|
-
if (!guard(req, res, this.opts)) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const parsed = teardownRequestSchema.safeParse(req.body);
|
|
78
|
-
if (!parsed.success) {
|
|
79
|
-
res.status(400).json({ error: "Invalid request body" });
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const items = parsed.data.batch.map((b) => ({
|
|
83
|
-
data: b.data,
|
|
84
|
-
names: b.preconditions,
|
|
85
|
-
runId: b.runId
|
|
86
|
-
}));
|
|
87
|
-
const results = await this.opts.engine.teardown(items);
|
|
88
|
-
res.status(200).json({ results: toTeardownResults(results) });
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
__decorateClass([
|
|
92
|
-
Put("execute-preconditions"),
|
|
93
|
-
__decorateParam(0, Req()),
|
|
94
|
-
__decorateParam(1, Res())
|
|
95
|
-
], RipploController.prototype, "executePreconditions", 1);
|
|
96
|
-
__decorateClass([
|
|
97
|
-
Put("execute-observer"),
|
|
98
|
-
__decorateParam(0, Req()),
|
|
99
|
-
__decorateParam(1, Res())
|
|
100
|
-
], RipploController.prototype, "executeObserver", 1);
|
|
101
|
-
__decorateClass([
|
|
102
|
-
Put("teardown-preconditions"),
|
|
103
|
-
__decorateParam(0, Req()),
|
|
104
|
-
__decorateParam(1, Res())
|
|
105
|
-
], RipploController.prototype, "teardown", 1);
|
|
106
|
-
RipploController = __decorateClass([
|
|
107
|
-
Controller(path),
|
|
108
|
-
__decorateParam(0, Inject(RIPPLO_OPTIONS))
|
|
109
|
-
], RipploController);
|
|
110
|
-
return RipploController;
|
|
111
|
-
}
|
|
112
|
-
function guard(req, res, opts) {
|
|
113
|
-
if (!opts.enabled) {
|
|
114
|
-
res.status(404).json({ error: "Not found" });
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
const webhookSecret = readAdapterWebhookSecret();
|
|
118
|
-
if (webhookSecret.length === 0) {
|
|
119
|
-
res.status(403).json({ error: "Webhook secret not configured" });
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
const payload = JSON.stringify(req.body);
|
|
123
|
-
const headers = {
|
|
124
|
-
"webhook-id": headerString(req.get("webhook-id")),
|
|
125
|
-
"webhook-signature": headerString(req.get("webhook-signature")),
|
|
126
|
-
"webhook-timestamp": headerString(req.get("webhook-timestamp"))
|
|
127
|
-
};
|
|
128
|
-
if (!verifyWebhookSignature(payload, headers, webhookSecret)) {
|
|
129
|
-
res.status(401).json({ error: "Invalid webhook signature" });
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
function headerString(value) {
|
|
135
|
-
return value != null && value.length > 0 ? value : void 0;
|
|
136
|
-
}
|
|
137
|
-
export {
|
|
138
|
-
RipploTestingModule
|
|
139
|
-
};
|
package/dist/nextjs.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { R as RipploEngine } from './engine-BOqzK_go.js';
|
|
2
|
-
import './builder-SsgqYqSC.js';
|
|
3
|
-
import './types-BzZrl65Z.js';
|
|
4
|
-
import './step-De52hTLd.js';
|
|
5
|
-
import '@ripplo/spec';
|
|
6
|
-
|
|
7
|
-
interface CreateNextHandlerParams {
|
|
8
|
-
readonly enabled: boolean;
|
|
9
|
-
readonly engine: RipploEngine;
|
|
10
|
-
}
|
|
11
|
-
type NextHandler = (req: Request) => Promise<Response>;
|
|
12
|
-
declare function createNextHandler({ enabled, engine }: CreateNextHandlerParams): NextHandler;
|
|
13
|
-
|
|
14
|
-
export { type CreateNextHandlerParams, createNextHandler };
|
package/dist/nextjs.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
batchRequestSchema,
|
|
3
|
-
observerRequestSchema,
|
|
4
|
-
readAdapterWebhookSecret,
|
|
5
|
-
teardownRequestSchema,
|
|
6
|
-
toBatchRunResults,
|
|
7
|
-
toTeardownResults,
|
|
8
|
-
verifyWebhookSignature
|
|
9
|
-
} from "./chunk-XO36IU66.js";
|
|
10
|
-
import "./chunk-4MGIQFAJ.js";
|
|
11
|
-
|
|
12
|
-
// src/adapters/nextjs.ts
|
|
13
|
-
function createNextHandler({ enabled, engine }) {
|
|
14
|
-
if (!enabled) {
|
|
15
|
-
return async () => jsonResponse({ error: "Not found" }, 404);
|
|
16
|
-
}
|
|
17
|
-
const webhookSecret = readAdapterWebhookSecret();
|
|
18
|
-
return async function handler(req) {
|
|
19
|
-
const action = lastPathSegment(req.url);
|
|
20
|
-
if (action !== "execute-preconditions" && action !== "teardown-preconditions" && action !== "execute-observer") {
|
|
21
|
-
return jsonResponse({ error: "Not found" }, 404);
|
|
22
|
-
}
|
|
23
|
-
const verified = await verifyAndReadBody(req, webhookSecret);
|
|
24
|
-
if ("error" in verified) {
|
|
25
|
-
return verified.error;
|
|
26
|
-
}
|
|
27
|
-
return runGuarded(() => dispatchAction({ action, body: verified.body, engine, req }));
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function dispatchAction({ action, body, engine, req }) {
|
|
31
|
-
if (action === "execute-preconditions") {
|
|
32
|
-
return handleExecutePreconditions({ body, engine, req });
|
|
33
|
-
}
|
|
34
|
-
if (action === "execute-observer") {
|
|
35
|
-
return handleExecuteObserver({ body, engine });
|
|
36
|
-
}
|
|
37
|
-
return handleTeardown({ body, engine });
|
|
38
|
-
}
|
|
39
|
-
async function handleExecuteObserver({
|
|
40
|
-
body,
|
|
41
|
-
engine
|
|
42
|
-
}) {
|
|
43
|
-
const json = tryParseJson(body);
|
|
44
|
-
const parsed = json == null ? null : observerRequestSchema.safeParse(json);
|
|
45
|
-
if (parsed == null || !parsed.success) {
|
|
46
|
-
return jsonResponse({ error: "Invalid request body", success: false }, 400);
|
|
47
|
-
}
|
|
48
|
-
const result = await engine.executeObserver(parsed.data.observer, parsed.data.params);
|
|
49
|
-
return jsonResponse(
|
|
50
|
-
{ error: result.error, outcome: result.outcome, success: result.success },
|
|
51
|
-
200
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
async function handleExecutePreconditions({
|
|
55
|
-
body,
|
|
56
|
-
engine,
|
|
57
|
-
req
|
|
58
|
-
}) {
|
|
59
|
-
const json = tryParseJson(body);
|
|
60
|
-
const parsed = json == null ? null : batchRequestSchema.safeParse(json);
|
|
61
|
-
if (parsed == null || !parsed.success) {
|
|
62
|
-
return jsonResponse({ error: "Invalid request body" }, 400);
|
|
63
|
-
}
|
|
64
|
-
const host = req.headers.get("host");
|
|
65
|
-
if (host == null || host.length === 0) {
|
|
66
|
-
return jsonResponse({ error: "Missing host header" }, 400);
|
|
67
|
-
}
|
|
68
|
-
const proto = req.headers.get("x-forwarded-proto") ?? "http";
|
|
69
|
-
const appUrl = `${proto}://${host}`;
|
|
70
|
-
const items = parsed.data.batch.map((b) => ({ names: b.preconditions, runId: b.runId }));
|
|
71
|
-
const results = await engine.executePreconditions(items, { appUrl });
|
|
72
|
-
return jsonResponse({ results: toBatchRunResults(results) }, 200);
|
|
73
|
-
}
|
|
74
|
-
async function handleTeardown({ body, engine }) {
|
|
75
|
-
const json = tryParseJson(body);
|
|
76
|
-
const parsed = json == null ? null : teardownRequestSchema.safeParse(json);
|
|
77
|
-
if (parsed == null || !parsed.success) {
|
|
78
|
-
return jsonResponse({ error: "Invalid request body" }, 400);
|
|
79
|
-
}
|
|
80
|
-
const items = parsed.data.batch.map((b) => ({
|
|
81
|
-
data: b.data,
|
|
82
|
-
names: b.preconditions,
|
|
83
|
-
runId: b.runId
|
|
84
|
-
}));
|
|
85
|
-
const results = await engine.teardown(items);
|
|
86
|
-
return jsonResponse({ results: toTeardownResults(results) }, 200);
|
|
87
|
-
}
|
|
88
|
-
async function verifyAndReadBody(req, webhookSecret) {
|
|
89
|
-
if (webhookSecret.length === 0) {
|
|
90
|
-
return { error: jsonResponse({ error: "Webhook secret not configured" }, 403) };
|
|
91
|
-
}
|
|
92
|
-
const body = await req.text();
|
|
93
|
-
const headers = {
|
|
94
|
-
"webhook-id": req.headers.get("webhook-id") ?? void 0,
|
|
95
|
-
"webhook-signature": req.headers.get("webhook-signature") ?? void 0,
|
|
96
|
-
"webhook-timestamp": req.headers.get("webhook-timestamp") ?? void 0
|
|
97
|
-
};
|
|
98
|
-
if (!verifyWebhookSignature(body, headers, webhookSecret)) {
|
|
99
|
-
return { error: jsonResponse({ error: "Invalid webhook signature" }, 401) };
|
|
100
|
-
}
|
|
101
|
-
return { body };
|
|
102
|
-
}
|
|
103
|
-
async function runGuarded(fn) {
|
|
104
|
-
try {
|
|
105
|
-
return await fn();
|
|
106
|
-
} catch (error) {
|
|
107
|
-
return jsonResponse(
|
|
108
|
-
{
|
|
109
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
|
110
|
-
stack: error instanceof Error ? error.stack : void 0,
|
|
111
|
-
success: false
|
|
112
|
-
},
|
|
113
|
-
500
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function lastPathSegment(url) {
|
|
118
|
-
const pathname = new URL(url).pathname;
|
|
119
|
-
const segments = pathname.split("/").filter((s) => s.length > 0);
|
|
120
|
-
return segments.at(-1) ?? "";
|
|
121
|
-
}
|
|
122
|
-
function tryParseJson(body) {
|
|
123
|
-
try {
|
|
124
|
-
return JSON.parse(body);
|
|
125
|
-
} catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function jsonResponse(payload, status) {
|
|
130
|
-
return new Response(JSON.stringify(payload), {
|
|
131
|
-
headers: { "content-type": "application/json" },
|
|
132
|
-
status
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
export {
|
|
136
|
-
createNextHandler
|
|
137
|
-
};
|
package/dist/step-De52hTLd.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SpecNode } from '@ripplo/spec';
|
|
2
|
-
|
|
3
|
-
type DslNodeType = "assertAttribute" | "assertChecked" | "assertCount" | "assertDisabled" | "assertEnabled" | "assertFocused" | "assertNotChecked" | "assertNotFocused" | "assertNotVisible" | "assertObserver" | "assertText" | "assertUrl" | "assertValue" | "assertVisible" | "check" | "clear" | "click" | "clipboard" | "dblclick" | "drag" | "extractText" | "fill" | "focus" | "goto" | "handleDialog" | "hover" | "press" | "rightClick" | "scrollIntoView" | "select" | "setPermission" | "setViewport" | "type" | "uncheck" | "upload";
|
|
4
|
-
type StepBaseFields = "comment" | "id" | "label" | "next" | "timeout";
|
|
5
|
-
type DslNodeInput = SpecNode extends infer N ? N extends SpecNode ? N["type"] extends DslNodeType ? Omit<N, StepBaseFields> : never : never : never;
|
|
6
|
-
|
|
7
|
-
declare const STEP_INTERNAL: unique symbol;
|
|
8
|
-
interface StepData<TNode extends DslNodeInput> {
|
|
9
|
-
readonly label: string;
|
|
10
|
-
readonly node: TNode;
|
|
11
|
-
}
|
|
12
|
-
interface Step<TNode extends DslNodeInput = DslNodeInput> {
|
|
13
|
-
readonly [STEP_INTERNAL]: StepData<TNode>;
|
|
14
|
-
}
|
|
15
|
-
interface UnlabeledStep<TNode extends DslNodeInput = DslNodeInput> {
|
|
16
|
-
as(label: string): Step<TNode>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type { DslNodeInput as D, Step as S, UnlabeledStep as U };
|
package/dist/types-BzZrl65Z.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { S as Step } from './step-De52hTLd.js';
|
|
2
|
-
|
|
3
|
-
declare const DEFAULT_WATCH_PATHS: ReadonlyArray<string>;
|
|
4
|
-
declare const DEFAULT_IGNORE_PATHS: ReadonlyArray<string>;
|
|
5
|
-
interface CookieOptions {
|
|
6
|
-
readonly domain: string | undefined;
|
|
7
|
-
readonly expires: number | undefined;
|
|
8
|
-
readonly httpOnly: boolean | undefined;
|
|
9
|
-
readonly path: string | undefined;
|
|
10
|
-
readonly sameSite: "lax" | "none" | "strict" | undefined;
|
|
11
|
-
readonly secure: boolean | undefined;
|
|
12
|
-
}
|
|
13
|
-
interface CookieEntry {
|
|
14
|
-
readonly name: string;
|
|
15
|
-
readonly options: CookieOptions | undefined;
|
|
16
|
-
readonly value: string;
|
|
17
|
-
}
|
|
18
|
-
declare const TEST_VALUE_BRAND: unique symbol;
|
|
19
|
-
type Primitive = boolean | number | string;
|
|
20
|
-
type TestValue<T extends Primitive> = T & {
|
|
21
|
-
readonly [TEST_VALUE_BRAND]: true;
|
|
22
|
-
};
|
|
23
|
-
interface SetupContext {
|
|
24
|
-
readonly runId: string;
|
|
25
|
-
fixed<T extends Primitive>(value: T): TestValue<T>;
|
|
26
|
-
setCookie(name: string, value: string, options?: CookieOptions): void;
|
|
27
|
-
uniqueEmail(): TestValue<string>;
|
|
28
|
-
uniqueId(prefix: string): TestValue<string>;
|
|
29
|
-
}
|
|
30
|
-
interface TeardownContext<TData extends Record<string, Primitive>> {
|
|
31
|
-
readonly data: TData;
|
|
32
|
-
}
|
|
33
|
-
declare const PRECONDITION_DATA: unique symbol;
|
|
34
|
-
declare const PRECONDITION_DEPS: unique symbol;
|
|
35
|
-
declare const PRECONDITION_NAME: unique symbol;
|
|
36
|
-
interface Precondition<TData extends Record<string, Primitive> = Record<string, Primitive>, TDeps extends Record<string, Record<string, Primitive>> = Record<string, Record<string, Primitive>>> {
|
|
37
|
-
readonly [PRECONDITION_DATA]: TData;
|
|
38
|
-
readonly [PRECONDITION_DEPS]: TDeps;
|
|
39
|
-
readonly [PRECONDITION_NAME]: string;
|
|
40
|
-
}
|
|
41
|
-
type PreconditionData<T extends Precondition> = T[typeof PRECONDITION_DATA];
|
|
42
|
-
type PreconditionDeps<T extends Precondition> = T[typeof PRECONDITION_DEPS];
|
|
43
|
-
interface PreconditionDefinitionSetupItem {
|
|
44
|
-
readonly ctx: SetupContext;
|
|
45
|
-
readonly deps: Record<string, Record<string, Primitive>>;
|
|
46
|
-
}
|
|
47
|
-
interface PreconditionDefinitionTeardownItem {
|
|
48
|
-
readonly ctx: TeardownContext<Record<string, Primitive>>;
|
|
49
|
-
}
|
|
50
|
-
interface PreconditionDefinition {
|
|
51
|
-
readonly dependsOn: ReadonlyArray<string>;
|
|
52
|
-
readonly depMapping: ReadonlyArray<readonly [string, string]>;
|
|
53
|
-
readonly description: string;
|
|
54
|
-
readonly implemented: boolean;
|
|
55
|
-
readonly name: string;
|
|
56
|
-
readonly returns: ReadonlyArray<string>;
|
|
57
|
-
readonly teardown: ((items: ReadonlyArray<PreconditionDefinitionTeardownItem>) => Promise<void>) | undefined;
|
|
58
|
-
readonly setup: (items: ReadonlyArray<PreconditionDefinitionSetupItem>) => Promise<ReadonlyArray<Record<string, Primitive>>>;
|
|
59
|
-
}
|
|
60
|
-
type VarsFn<T> = (vars: Record<string, Record<string, Primitive>>) => T;
|
|
61
|
-
interface TestDefinition {
|
|
62
|
-
readonly coverage: ReadonlyArray<string>;
|
|
63
|
-
readonly description: string;
|
|
64
|
-
readonly expectedOutcome: string;
|
|
65
|
-
readonly id: string;
|
|
66
|
-
readonly implemented: boolean;
|
|
67
|
-
readonly name: string;
|
|
68
|
-
readonly requires: ReadonlyArray<string>;
|
|
69
|
-
readonly requiresKeys: Record<string, string>;
|
|
70
|
-
readonly sourcePath: string | undefined;
|
|
71
|
-
readonly startsAtFn: VarsFn<string> | undefined;
|
|
72
|
-
readonly stepsFn: VarsFn<ReadonlyArray<Step>> | undefined;
|
|
73
|
-
readonly uiOnly: boolean | undefined;
|
|
74
|
-
}
|
|
75
|
-
interface UnimplementedItems {
|
|
76
|
-
readonly observers: ReadonlyArray<string>;
|
|
77
|
-
readonly preconditions: ReadonlyArray<string>;
|
|
78
|
-
readonly tests: ReadonlyArray<string>;
|
|
79
|
-
}
|
|
80
|
-
declare const OBSERVER_INPUT: unique symbol;
|
|
81
|
-
declare const OBSERVER_NAME: unique symbol;
|
|
82
|
-
interface ObserverHandle<TInput = unknown> {
|
|
83
|
-
readonly [OBSERVER_INPUT]: TInput;
|
|
84
|
-
readonly [OBSERVER_NAME]: string;
|
|
85
|
-
}
|
|
86
|
-
type ObserverInput<T extends ObserverHandle> = T[typeof OBSERVER_INPUT];
|
|
87
|
-
declare const OBSERVER_OUTCOME_BRAND: unique symbol;
|
|
88
|
-
type ObserverOutcome = {
|
|
89
|
-
readonly kind: "pass";
|
|
90
|
-
readonly [OBSERVER_OUTCOME_BRAND]: true;
|
|
91
|
-
} | {
|
|
92
|
-
readonly kind: "retry";
|
|
93
|
-
readonly [OBSERVER_OUTCOME_BRAND]: true;
|
|
94
|
-
readonly reason: string;
|
|
95
|
-
} | {
|
|
96
|
-
readonly kind: "fail";
|
|
97
|
-
readonly [OBSERVER_OUTCOME_BRAND]: true;
|
|
98
|
-
readonly reason: string;
|
|
99
|
-
};
|
|
100
|
-
interface ObserverContext {
|
|
101
|
-
readonly runId: string;
|
|
102
|
-
fail(reason: string): ObserverOutcome;
|
|
103
|
-
pass(): ObserverOutcome;
|
|
104
|
-
retry(reason: string): ObserverOutcome;
|
|
105
|
-
}
|
|
106
|
-
type ObserverBudgetTier = "async" | "fast" | "slow";
|
|
107
|
-
interface ObserverDefinition {
|
|
108
|
-
readonly budget: ObserverBudgetTier;
|
|
109
|
-
readonly description: string;
|
|
110
|
-
readonly implemented: boolean;
|
|
111
|
-
readonly name: string;
|
|
112
|
-
readonly run: (ctx: ObserverContext, params: Record<string, Primitive>) => Promise<ObserverOutcome>;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export { type CookieEntry as C, DEFAULT_IGNORE_PATHS as D, type ObserverHandle as O, type Primitive as P, type SetupContext as S, type TeardownContext as T, type UnimplementedItems as U, type ObserverInput as a, type ObserverBudgetTier as b, type CookieOptions as c, DEFAULT_WATCH_PATHS as d, type ObserverContext as e, type ObserverDefinition as f, type ObserverOutcome as g, type Precondition as h, type PreconditionDeps as i, type TestDefinition as j, type TestValue as k, type PreconditionDefinition as l, type PreconditionData as m };
|