@glubean/sdk 0.2.1 → 0.2.2
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/dist/configure/http.d.ts +25 -0
- package/dist/configure/http.d.ts.map +1 -0
- package/dist/configure/http.js +88 -0
- package/dist/configure/http.js.map +1 -0
- package/dist/configure/index.d.ts +78 -0
- package/dist/configure/index.d.ts.map +1 -0
- package/dist/configure/index.js +78 -0
- package/dist/configure/index.js.map +1 -0
- package/dist/configure/plugin.d.ts +23 -0
- package/dist/configure/plugin.d.ts.map +1 -0
- package/dist/configure/plugin.js +81 -0
- package/dist/configure/plugin.js.map +1 -0
- package/dist/configure/runtime.d.ts +24 -0
- package/dist/configure/runtime.d.ts.map +1 -0
- package/dist/configure/runtime.js +45 -0
- package/dist/configure/runtime.js.map +1 -0
- package/dist/configure/template.d.ts +22 -0
- package/dist/configure/template.d.ts.map +1 -0
- package/dist/configure/template.js +34 -0
- package/dist/configure/template.js.map +1 -0
- package/dist/configure/vars.d.ts +20 -0
- package/dist/configure/vars.d.ts.map +1 -0
- package/dist/configure/vars.js +48 -0
- package/dist/configure/vars.js.map +1 -0
- package/dist/configure.d.ts +2 -133
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +2 -436
- package/dist/configure.js.map +1 -1
- package/dist/contract-artifacts.d.ts +268 -0
- package/dist/contract-artifacts.d.ts.map +1 -0
- package/dist/contract-artifacts.js +402 -0
- package/dist/contract-artifacts.js.map +1 -0
- package/dist/contract-core.d.ts +30 -0
- package/dist/contract-core.d.ts.map +1 -1
- package/dist/contract-core.js +47 -0
- package/dist/contract-core.js.map +1 -1
- package/dist/contract-http/adapter.d.ts.map +1 -1
- package/dist/contract-http/adapter.js +22 -7
- package/dist/contract-http/adapter.js.map +1 -1
- package/dist/contract-http/factory.d.ts.map +1 -1
- package/dist/contract-http/factory.js +13 -14
- package/dist/contract-http/factory.js.map +1 -1
- package/dist/contract-http/openapi.d.ts +56 -7
- package/dist/contract-http/openapi.d.ts.map +1 -1
- package/dist/contract-http/openapi.js +371 -21
- package/dist/contract-http/openapi.js.map +1 -1
- package/dist/contract-http/types.d.ts +2 -13
- package/dist/contract-http/types.d.ts.map +1 -1
- package/dist/contract-types.d.ts +59 -10
- package/dist/contract-types.d.ts.map +1 -1
- package/dist/expect.d.ts +13 -0
- package/dist/expect.d.ts.map +1 -1
- package/dist/expect.js +18 -0
- package/dist/expect.js.map +1 -1
- package/dist/index.d.ts +55 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/install-plugin.d.ts +94 -0
- package/dist/install-plugin.d.ts.map +1 -0
- package/dist/install-plugin.js +222 -0
- package/dist/install-plugin.js.map +1 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +5 -0
- package/dist/internal.js.map +1 -1
- package/dist/plugin.d.ts +45 -34
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +47 -34
- package/dist/plugin.js.map +1 -1
- package/dist/{test-builder.d.ts → test/builder.d.ts} +2 -2
- package/dist/test/builder.d.ts.map +1 -0
- package/dist/{test-builder.js → test/builder.js} +3 -3
- package/dist/{test-builder.js.map → test/builder.js.map} +1 -1
- package/dist/{each-builder.d.ts → test/each-builder.d.ts} +1 -1
- package/dist/test/each-builder.d.ts.map +1 -0
- package/dist/{each-builder.js → test/each-builder.js} +3 -3
- package/dist/test/each-builder.js.map +1 -0
- package/dist/{test-extend.d.ts → test/extend.d.ts} +3 -3
- package/dist/test/extend.d.ts.map +1 -0
- package/dist/{test-extend.js → test/extend.js} +5 -5
- package/dist/test/extend.js.map +1 -0
- package/dist/{test-utils.d.ts → test/utils.d.ts} +2 -2
- package/dist/test/utils.d.ts.map +1 -0
- package/dist/{test-utils.js → test/utils.js} +1 -1
- package/dist/test/utils.js.map +1 -0
- package/dist/types.d.ts +78 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/contract-http/markdown.d.ts +0 -10
- package/dist/contract-http/markdown.d.ts.map +0 -1
- package/dist/contract-http/markdown.js +0 -21
- package/dist/contract-http/markdown.js.map +0 -1
- package/dist/each-builder.d.ts.map +0 -1
- package/dist/each-builder.js.map +0 -1
- package/dist/test-builder.d.ts.map +0 -1
- package/dist/test-extend.d.ts.map +0 -1
- package/dist/test-extend.js.map +0 -1
- package/dist/test-utils.d.ts.map +0 -1
- package/dist/test-utils.js.map +0 -1
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module install-plugin
|
|
3
|
+
*
|
|
4
|
+
* Plugin manifest installation driver — the single entry point for plugin-level
|
|
5
|
+
* global registration. Builds on top of the low-level primitives
|
|
6
|
+
* (`Expectation.extend`, `contract.register`) to provide:
|
|
7
|
+
*
|
|
8
|
+
* - **Plugin identity** — every manifest has a `name`, tracked for diagnostics.
|
|
9
|
+
* - **Conflict detection** — duplicate matcher/protocol names throw, whether the
|
|
10
|
+
* prior registration was from another plugin manifest or from a direct call
|
|
11
|
+
* to the low-level primitive.
|
|
12
|
+
* - **Idempotent install** — re-installing the same plugin (by `name`) is a no-op.
|
|
13
|
+
* - **Failed-setup isolation** — if a plugin's `setup()` throws, the plugin is
|
|
14
|
+
* marked as setup-failed; retrying the same plugin in the same process raises
|
|
15
|
+
* a clear error rather than silently re-registering matchers/contracts.
|
|
16
|
+
* - **Install-order hooks** — `setup()` runs after matchers/contracts are registered.
|
|
17
|
+
*
|
|
18
|
+
* `installPlugin` is the recommended surface for plugin authors. The primitives
|
|
19
|
+
* (`Expectation.extend`, `contract.register`) remain public for inline patching
|
|
20
|
+
* or prototyping. `installPlugin` still detects collisions against them — a
|
|
21
|
+
* plugin trying to register a matcher/protocol that a direct primitive call
|
|
22
|
+
* already owns will throw.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link PluginManifest} in `./types.js`
|
|
25
|
+
*/
|
|
26
|
+
import { Expectation } from "./expect.js";
|
|
27
|
+
import { contract, getAdapter, __unregisterProtocolForTesting } from "./contract-core.js";
|
|
28
|
+
/**
|
|
29
|
+
* Registry of fully installed plugins (matchers + contracts + setup all
|
|
30
|
+
* succeeded), keyed by manifest `name`. Feeds `listInstalledPlugins()`.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
const installed = new Map();
|
|
34
|
+
/**
|
|
35
|
+
* Plugins whose `setup()` threw. Matchers/contracts they registered remain
|
|
36
|
+
* on the globals (irreversible), but the plugin is NOT in `installed`.
|
|
37
|
+
* Retrying such a plugin in the same process throws immediately.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
const setupFailures = new Map();
|
|
41
|
+
/**
|
|
42
|
+
* Reverse index: which plugin owns which matcher name?
|
|
43
|
+
* Keyed by matcher name → plugin name.
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
const matcherOwners = new Map();
|
|
47
|
+
/**
|
|
48
|
+
* Reverse index: which plugin owns which protocol name?
|
|
49
|
+
* Keyed by protocol name → plugin name.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
const protocolOwners = new Map();
|
|
53
|
+
/**
|
|
54
|
+
* Install one or more plugin manifests. Drives registration in strict order:
|
|
55
|
+
*
|
|
56
|
+
* 1. Validate the manifest shape.
|
|
57
|
+
* 2. Check each matcher/protocol name for conflicts (both across plugins and
|
|
58
|
+
* against direct primitive registrations). Throws on first conflict.
|
|
59
|
+
* 3. Register all matchers via `Expectation.extend`.
|
|
60
|
+
* 4. Register all contracts via `contract.register`.
|
|
61
|
+
* 5. Run `setup()` if present (awaited).
|
|
62
|
+
* 6. Record the plugin in the installed registry.
|
|
63
|
+
*
|
|
64
|
+
* Subsequent calls with an already-installed plugin (same `name`) are no-ops.
|
|
65
|
+
* Subsequent calls with a previously-setup-failed plugin throw.
|
|
66
|
+
*
|
|
67
|
+
* **Failure semantics**: if `setup()` throws, the process is left in a
|
|
68
|
+
* partially-initialized state (matchers/contracts from this plugin are on
|
|
69
|
+
* the globals but `installed` does not list the plugin). This state is
|
|
70
|
+
* **not recoverable within the same process** — the only clean remedy is to
|
|
71
|
+
* restart. Retrying the same plugin raises a clear error instead of silently
|
|
72
|
+
* re-registering.
|
|
73
|
+
*
|
|
74
|
+
* @param plugins One or more manifests to install, in order.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* import { installPlugin } from "@glubean/sdk";
|
|
79
|
+
* import graphqlPlugin from "@glubean/graphql";
|
|
80
|
+
* import grpcPlugin from "@glubean/grpc";
|
|
81
|
+
*
|
|
82
|
+
* await installPlugin(graphqlPlugin, grpcPlugin);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export async function installPlugin(...plugins) {
|
|
86
|
+
for (const plugin of plugins) {
|
|
87
|
+
if (!plugin || typeof plugin !== "object" || typeof plugin.name !== "string") {
|
|
88
|
+
throw new Error("installPlugin: expected a PluginManifest with a string `name` field. " +
|
|
89
|
+
`Got: ${typeof plugin === "object" ? JSON.stringify(plugin) : typeof plugin}.`);
|
|
90
|
+
}
|
|
91
|
+
// Fast-path: successful re-install is idempotent.
|
|
92
|
+
if (installed.has(plugin.name)) {
|
|
93
|
+
if (typeof process !== "undefined" && process.env?.["GLUBEAN_DEBUG"]) {
|
|
94
|
+
process.stderr.write(`[glubean:debug] installPlugin: skipping duplicate install of "${plugin.name}"\n`);
|
|
95
|
+
}
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
// Failed-setup path: matchers/contracts from a prior failed attempt are
|
|
99
|
+
// still on the globals, so re-registering them would double-register.
|
|
100
|
+
// Throw with full context rather than silently continuing.
|
|
101
|
+
const prevFailure = setupFailures.get(plugin.name);
|
|
102
|
+
if (prevFailure) {
|
|
103
|
+
throw new Error(`installPlugin("${plugin.name}"): previous setup() attempt failed in this process ` +
|
|
104
|
+
`and left matchers/contracts partially registered. This state is not recoverable — ` +
|
|
105
|
+
`restart the process to retry. Original error: ${prevFailure.message}`);
|
|
106
|
+
}
|
|
107
|
+
// --- Pre-flight conflict checks --------------------------------------
|
|
108
|
+
// Done BEFORE any mutation so a conflict on the Nth matcher doesn't leave
|
|
109
|
+
// the first N-1 matchers on the prototype.
|
|
110
|
+
if (plugin.matchers) {
|
|
111
|
+
for (const name of Object.keys(plugin.matchers)) {
|
|
112
|
+
const existingOwner = matcherOwners.get(name);
|
|
113
|
+
if (existingOwner) {
|
|
114
|
+
throw new Error(`installPlugin("${plugin.name}"): matcher "${name}" is already registered ` +
|
|
115
|
+
`by plugin "${existingOwner}". ` +
|
|
116
|
+
`Each matcher name can only be owned by one plugin.`);
|
|
117
|
+
}
|
|
118
|
+
// Catch matchers registered via a direct `Expectation.extend()` call
|
|
119
|
+
// that bypassed installPlugin. Expectation.extend itself would throw
|
|
120
|
+
// when we try to register, but with a generic message — pre-check so
|
|
121
|
+
// the error names the plugin that's trying to register.
|
|
122
|
+
if (name in Expectation.prototype) {
|
|
123
|
+
throw new Error(`installPlugin("${plugin.name}"): matcher "${name}" already exists on Expectation.prototype ` +
|
|
124
|
+
`(likely registered by a direct Expectation.extend() call or a built-in matcher). ` +
|
|
125
|
+
`Matcher names must be unique across the entire process.`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (plugin.contracts) {
|
|
130
|
+
for (const protocol of Object.keys(plugin.contracts)) {
|
|
131
|
+
const existingOwner = protocolOwners.get(protocol);
|
|
132
|
+
if (existingOwner) {
|
|
133
|
+
throw new Error(`installPlugin("${plugin.name}"): protocol "${protocol}" is already registered ` +
|
|
134
|
+
`by plugin "${existingOwner}". ` +
|
|
135
|
+
`Each protocol name can only be owned by one plugin.`);
|
|
136
|
+
}
|
|
137
|
+
// Catch protocols registered via a direct `contract.register()` call
|
|
138
|
+
// that bypassed installPlugin. Unlike Expectation.extend, the current
|
|
139
|
+
// contract.register has no built-in duplicate guard — it would
|
|
140
|
+
// silently overwrite the live adapter. Pre-check via getAdapter().
|
|
141
|
+
if (getAdapter(protocol)) {
|
|
142
|
+
throw new Error(`installPlugin("${plugin.name}"): protocol "${protocol}" is already present in the contract registry ` +
|
|
143
|
+
`(likely registered by a direct contract.register() call). ` +
|
|
144
|
+
`Protocol names must be unique across the entire process.`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// --- Mutations (past this point, prototype/registry get modified) ----
|
|
149
|
+
if (plugin.matchers) {
|
|
150
|
+
for (const [name, fn] of Object.entries(plugin.matchers)) {
|
|
151
|
+
Expectation.extend({ [name]: fn });
|
|
152
|
+
matcherOwners.set(name, plugin.name);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (plugin.contracts) {
|
|
156
|
+
for (const [protocol, adapter] of Object.entries(plugin.contracts)) {
|
|
157
|
+
contract.register(protocol, adapter);
|
|
158
|
+
protocolOwners.set(protocol, plugin.name);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// --- Setup hook (failure leaves partial state) -----------------------
|
|
162
|
+
if (plugin.setup) {
|
|
163
|
+
try {
|
|
164
|
+
await plugin.setup();
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
168
|
+
setupFailures.set(plugin.name, error);
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
installed.set(plugin.name, plugin);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Return a snapshot array of all successfully installed plugin manifests, in
|
|
177
|
+
* install order. Plugins whose `setup()` threw are **not** included.
|
|
178
|
+
*
|
|
179
|
+
* The returned array is a shallow copy — mutating it does not affect the
|
|
180
|
+
* installed state. Manifest objects themselves are returned by reference.
|
|
181
|
+
*/
|
|
182
|
+
export function listInstalledPlugins() {
|
|
183
|
+
return [...installed.values()];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Clear all installed-plugin state. **Test-only.**
|
|
187
|
+
*
|
|
188
|
+
* Performs a **true reset**:
|
|
189
|
+
* 1. Unregisters every matcher previously installed via a plugin manifest
|
|
190
|
+
* from `Expectation.prototype`.
|
|
191
|
+
* 2. Unregisters every protocol adapter previously installed via a plugin
|
|
192
|
+
* manifest from the contract registry (`_adapters` + `contract[protocol]`).
|
|
193
|
+
* 3. Clears all internal tracking maps (`installed`, `matcherOwners`,
|
|
194
|
+
* `protocolOwners`, `setupFailures`).
|
|
195
|
+
*
|
|
196
|
+
* **Scope limits:**
|
|
197
|
+
* - Only touches registrations introduced via `installPlugin`. Matchers /
|
|
198
|
+
* protocols registered via a direct call to the primitive (bypassing
|
|
199
|
+
* `installPlugin`) are **not** tracked by the owner maps and therefore
|
|
200
|
+
* will not be removed.
|
|
201
|
+
* - Built-in Expectation matchers (defined on the class body, not added
|
|
202
|
+
* via `extend()`) are unaffected because `delete` on a class-syntax
|
|
203
|
+
* method is a no-op.
|
|
204
|
+
*
|
|
205
|
+
* Intended for test suites that install plugins, need to simulate a
|
|
206
|
+
* fresh process, and then install again.
|
|
207
|
+
*
|
|
208
|
+
* @internal
|
|
209
|
+
*/
|
|
210
|
+
export function __resetInstalledPluginsForTesting() {
|
|
211
|
+
for (const [name] of matcherOwners) {
|
|
212
|
+
Expectation.__removeMatcherForTesting(name);
|
|
213
|
+
}
|
|
214
|
+
for (const [protocol] of protocolOwners) {
|
|
215
|
+
__unregisterProtocolForTesting(protocol);
|
|
216
|
+
}
|
|
217
|
+
installed.clear();
|
|
218
|
+
matcherOwners.clear();
|
|
219
|
+
protocolOwners.clear();
|
|
220
|
+
setupFailures.clear();
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=install-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-plugin.js","sourceRoot":"","sources":["../src/install-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,WAAW,EAAE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KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAClE,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACtC,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QAED,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,iCAAiC;IAC/C,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,aAAa,EAAE,CAAC;QACnC,WAAW,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,cAAc,EAAE,CAAC;QACxC,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IACD,SAAS,CAAC,KAAK,EAAE,CAAC;IAClB,aAAa,CAAC,KAAK,EAAE,CAAC;IACtB,cAAc,CAAC,KAAK,EAAE,CAAC;IACvB,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { RegisteredTestMeta } from "./types.js";
|
|
13
13
|
export { getRuntime, setRuntime, runWithRuntime, installCarrier, createGlobalThisCarrier, createAlsCarrier, type RuntimeCarrier, type InternalRuntime, } from "./runtime-carrier.js";
|
|
14
|
+
export { __resetInstalledPluginsForTesting, } from "./install-plugin.js";
|
|
14
15
|
/**
|
|
15
16
|
* Register a test to the global registry.
|
|
16
17
|
* Called internally by the test builders.
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EACL,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAW7B;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAE3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,IAAI,kBAAkB,EAAE,CAElD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
|
package/dist/internal.js
CHANGED
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export { getRuntime, setRuntime, runWithRuntime, installCarrier, createGlobalThisCarrier, createAlsCarrier, } from "./runtime-carrier.js";
|
|
13
|
+
// Internal-only test hook for plugin install state. Public callers use
|
|
14
|
+
// `installPlugin` / `listInstalledPlugins` from the main export. The matching
|
|
15
|
+
// bootstrap reset lives in `@glubean/runner/internal` alongside the bootstrap
|
|
16
|
+
// implementation (see runner/src/bootstrap.ts).
|
|
17
|
+
export { __resetInstalledPluginsForTesting, } from "./install-plugin.js";
|
|
13
18
|
/**
|
|
14
19
|
* Global registry for test metadata.
|
|
15
20
|
* Populated at import time when test files are loaded.
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,GAGjB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,SAAS,GAAyB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAwB;IACnD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,GAGjB,MAAM,sBAAsB,CAAC;AAE9B,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,gDAAgD;AAChD,OAAO,EACL,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,SAAS,GAAyB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAwB;IACnD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,56 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Plugin
|
|
2
|
+
* Plugin authoring helpers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* integrate with `configure({ plugins: { ... } })`. This is the recommended
|
|
6
|
-
* way to define plugins — it handles the `PluginFactory` phantom type trick
|
|
7
|
-
* so plugin authors don't need to understand it.
|
|
4
|
+
* Two APIs live here, one per concept:
|
|
8
5
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* 1. **`definePlugin(manifest)`** — declare a plugin manifest for global
|
|
7
|
+
* registration (matchers, protocol adapters, one-time setup). Consumed by
|
|
8
|
+
* {@link installPlugin} in `./install-plugin.js`. This is the primary API
|
|
9
|
+
* for plugin packages like `@glubean/graphql` and `@glubean/grpc`.
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
11
|
+
* 2. **`defineClientFactory(create)`** — declare a lazy client factory for
|
|
12
|
+
* per-file injection via `configure({ plugins })`. This is what the
|
|
13
|
+
* legacy `definePlugin((runtime) => T)` signature used to do; the name
|
|
14
|
+
* has been corrected to describe what it actually is (a client factory,
|
|
15
|
+
* not a plugin).
|
|
16
|
+
*
|
|
17
|
+
* The legacy `definePlugin((runtime) => T)` overload was removed in Phase 3.
|
|
18
|
+
* Migrate call sites to `defineClientFactory((runtime) => T)` for the same
|
|
19
|
+
* behavior and better naming.
|
|
19
20
|
*
|
|
20
21
|
* @module plugin
|
|
21
22
|
*/
|
|
22
|
-
import type { GlubeanRuntime,
|
|
23
|
+
import type { ClientFactory, GlubeanRuntime, PluginManifest } from "./types.js";
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Declare a lazy client factory.
|
|
25
26
|
*
|
|
26
|
-
* The factory function receives a `GlubeanRuntime`
|
|
27
|
-
*
|
|
27
|
+
* The factory function receives a `GlubeanRuntime` (vars / secrets / http /
|
|
28
|
+
* template resolution) and returns a client instance. It is invoked lazily on
|
|
28
29
|
* first property access during test execution, not at module load time.
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* Output is consumed by `configure({ plugins: { name: factory } })` for
|
|
32
|
+
* per-file client injection.
|
|
32
33
|
*
|
|
33
|
-
* @
|
|
34
|
+
* @param create Factory function receiving the runtime; returns the client.
|
|
35
|
+
* @returns A `ClientFactory<T>` suitable for `configure({ plugins })`.
|
|
36
|
+
*
|
|
37
|
+
* @example Simple client
|
|
34
38
|
* ```ts
|
|
35
|
-
* export const
|
|
36
|
-
*
|
|
39
|
+
* export const myClient = (opts: { baseUrlKey: string }) =>
|
|
40
|
+
* defineClientFactory((runtime) => {
|
|
37
41
|
* const baseUrl = runtime.requireVar(opts.baseUrlKey);
|
|
38
42
|
* return new MyClient(baseUrl);
|
|
39
43
|
* });
|
|
40
44
|
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function defineClientFactory<T>(create: (runtime: GlubeanRuntime) => T): ClientFactory<T>;
|
|
47
|
+
/**
|
|
48
|
+
* Declare a plugin manifest for global registration.
|
|
41
49
|
*
|
|
42
|
-
*
|
|
50
|
+
* The returned manifest is consumed by `installPlugin(...manifests)` at
|
|
51
|
+
* bootstrap time. A manifest can declare custom matchers, protocol adapters,
|
|
52
|
+
* and a one-time `setup()` hook. See {@link PluginManifest}.
|
|
53
|
+
*
|
|
54
|
+
* @example Plugin manifest
|
|
43
55
|
* ```ts
|
|
44
|
-
* export
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* });
|
|
56
|
+
* export default definePlugin({
|
|
57
|
+
* name: "@glubean/graphql",
|
|
58
|
+
* matchers: { toHaveGraphqlData, toHaveGraphqlErrorCode },
|
|
59
|
+
* contracts: { graphql: graphqlAdapter },
|
|
60
|
+
* setup() {
|
|
61
|
+
* // Optional one-time registration work
|
|
62
|
+
* },
|
|
63
|
+
* });
|
|
53
64
|
* ```
|
|
54
65
|
*/
|
|
55
|
-
export declare function definePlugin
|
|
66
|
+
export declare function definePlugin(manifest: PluginManifest): PluginManifest;
|
|
56
67
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,CAAC,GACrC,aAAa,CAAC,CAAC,CAAC,CAElB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAErE"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,57 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Plugin
|
|
2
|
+
* Plugin authoring helpers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* integrate with `configure({ plugins: { ... } })`. This is the recommended
|
|
6
|
-
* way to define plugins — it handles the `PluginFactory` phantom type trick
|
|
7
|
-
* so plugin authors don't need to understand it.
|
|
4
|
+
* Two APIs live here, one per concept:
|
|
8
5
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* 1. **`definePlugin(manifest)`** — declare a plugin manifest for global
|
|
7
|
+
* registration (matchers, protocol adapters, one-time setup). Consumed by
|
|
8
|
+
* {@link installPlugin} in `./install-plugin.js`. This is the primary API
|
|
9
|
+
* for plugin packages like `@glubean/graphql` and `@glubean/grpc`.
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
11
|
+
* 2. **`defineClientFactory(create)`** — declare a lazy client factory for
|
|
12
|
+
* per-file injection via `configure({ plugins })`. This is what the
|
|
13
|
+
* legacy `definePlugin((runtime) => T)` signature used to do; the name
|
|
14
|
+
* has been corrected to describe what it actually is (a client factory,
|
|
15
|
+
* not a plugin).
|
|
16
|
+
*
|
|
17
|
+
* The legacy `definePlugin((runtime) => T)` overload was removed in Phase 3.
|
|
18
|
+
* Migrate call sites to `defineClientFactory((runtime) => T)` for the same
|
|
19
|
+
* behavior and better naming.
|
|
19
20
|
*
|
|
20
21
|
* @module plugin
|
|
21
22
|
*/
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Declare a lazy client factory.
|
|
24
25
|
*
|
|
25
|
-
* The factory function receives a `GlubeanRuntime`
|
|
26
|
-
*
|
|
26
|
+
* The factory function receives a `GlubeanRuntime` (vars / secrets / http /
|
|
27
|
+
* template resolution) and returns a client instance. It is invoked lazily on
|
|
27
28
|
* first property access during test execution, not at module load time.
|
|
28
29
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
30
|
+
* Output is consumed by `configure({ plugins: { name: factory } })` for
|
|
31
|
+
* per-file client injection.
|
|
32
|
+
*
|
|
33
|
+
* @param create Factory function receiving the runtime; returns the client.
|
|
34
|
+
* @returns A `ClientFactory<T>` suitable for `configure({ plugins })`.
|
|
31
35
|
*
|
|
32
|
-
* @example Simple
|
|
36
|
+
* @example Simple client
|
|
33
37
|
* ```ts
|
|
34
|
-
* export const
|
|
35
|
-
*
|
|
38
|
+
* export const myClient = (opts: { baseUrlKey: string }) =>
|
|
39
|
+
* defineClientFactory((runtime) => {
|
|
36
40
|
* const baseUrl = runtime.requireVar(opts.baseUrlKey);
|
|
37
41
|
* return new MyClient(baseUrl);
|
|
38
42
|
* });
|
|
39
43
|
* ```
|
|
44
|
+
*/
|
|
45
|
+
export function defineClientFactory(create) {
|
|
46
|
+
return { __type: undefined, create };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Declare a plugin manifest for global registration.
|
|
40
50
|
*
|
|
41
|
-
*
|
|
51
|
+
* The returned manifest is consumed by `installPlugin(...manifests)` at
|
|
52
|
+
* bootstrap time. A manifest can declare custom matchers, protocol adapters,
|
|
53
|
+
* and a one-time `setup()` hook. See {@link PluginManifest}.
|
|
54
|
+
*
|
|
55
|
+
* @example Plugin manifest
|
|
42
56
|
* ```ts
|
|
43
|
-
* export
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* });
|
|
57
|
+
* export default definePlugin({
|
|
58
|
+
* name: "@glubean/graphql",
|
|
59
|
+
* matchers: { toHaveGraphqlData, toHaveGraphqlErrorCode },
|
|
60
|
+
* contracts: { graphql: graphqlAdapter },
|
|
61
|
+
* setup() {
|
|
62
|
+
* // Optional one-time registration work
|
|
63
|
+
* },
|
|
64
|
+
* });
|
|
52
65
|
* ```
|
|
53
66
|
*/
|
|
54
|
-
export function definePlugin(
|
|
55
|
-
return
|
|
67
|
+
export function definePlugin(manifest) {
|
|
68
|
+
return manifest;
|
|
56
69
|
}
|
|
57
70
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAQH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAsC;IAEtC,OAAO,EAAE,MAAM,EAAE,SAAyB,EAAE,MAAM,EAAE,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,QAAwB;IACnD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* State flows between steps via the return value of each step function.
|
|
9
9
|
* `.build()` is optional — the builder auto-registers via microtask.
|
|
10
10
|
*/
|
|
11
|
-
import type { ExtensionFn, StepMeta, Test, TestContext, TestMeta } from "
|
|
11
|
+
import type { ExtensionFn, StepMeta, Test, TestContext, TestMeta } from "../types.js";
|
|
12
12
|
/**
|
|
13
13
|
* Builder class for creating tests with a fluent API.
|
|
14
14
|
*
|
|
@@ -246,4 +246,4 @@ export declare class TestBuilder<S = unknown, Ctx extends TestContext = TestCont
|
|
|
246
246
|
*/
|
|
247
247
|
build(): Test<S>;
|
|
248
248
|
}
|
|
249
|
-
//# sourceMappingURL=
|
|
249
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/test/builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,WAAW,EAIX,QAAQ,EAER,IAAI,EACJ,WAAW,EACX,QAAQ,EACT,MAAM,aAAa,CAAC;AAIrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,WAAW,GAAG,WAAW;IACzE,OAAO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;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;CAYjB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { registerTest } from "
|
|
2
|
-
import { toArray } from "
|
|
1
|
+
import { registerTest } from "../internal.js";
|
|
2
|
+
import { toArray } from "../data.js";
|
|
3
3
|
/**
|
|
4
4
|
* Builder class for creating tests with a fluent API.
|
|
5
5
|
*
|
|
@@ -262,4 +262,4 @@ export class TestBuilder {
|
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
//# sourceMappingURL=
|
|
265
|
+
//# sourceMappingURL=builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/test/builder.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,OAAO,WAAW;IACd,KAAK,CAAW;IAChB,MAAM,CAAoB;IAC1B,SAAS,CAAuB;IAEhC,MAAM,GAA0B,EAAE,CAAC;IACnC,MAAM,GAAG,KAAK,CAAC;IAEvB,SAAS,CAAoC;IAE7C;;;OAGG;IACM,cAAc,GAAG,SAAkB,CAAC;IAE7C,YACE,EAAU,EACV,QAA2C;QAE3C,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,qEAAqE;QACrE,qEAAqE;QACrE,wEAAwE;QACxE,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAA0B;QAC7B,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B,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS;SAC9B,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK;QACH,IAAI,CAAC,SAAS,EAAE,CAAC;QAEjB,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,KAAK,EAAE,IAAI,CAAC,MAA6B;YACzC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the data row (`row`) as a third argument. One `Test` is generated per row.
|
|
9
9
|
* Also exports `EachStepFunction`, `EachSetupFunction`, `EachTeardownFunction` types.
|
|
10
10
|
*/
|
|
11
|
-
import type { ExtensionFn, StepMeta, Test, TestContext, TestMeta } from "
|
|
11
|
+
import type { ExtensionFn, StepMeta, Test, TestContext, TestMeta } from "../types.js";
|
|
12
12
|
/**
|
|
13
13
|
* Step function for data-driven builder tests.
|
|
14
14
|
* Receives context, current state, and the data row for this test.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"each-builder.d.ts","sourceRoot":"","sources":["../../src/test/each-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,WAAW,EAGX,QAAQ,EAER,IAAI,EACJ,WAAW,EACX,QAAQ,EACT,MAAM,aAAa,CAAC;AAKrB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,WAAW,GAAG,WAAW,IAAI,CAC1E,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,CAAC,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IAAI,CAAC,CAAC,CAAC,EAAE;CAiCnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerTest } from "
|
|
2
|
-
import { toArray } from "
|
|
3
|
-
import { interpolateTemplate } from "./
|
|
1
|
+
import { registerTest } from "../internal.js";
|
|
2
|
+
import { toArray } from "../data.js";
|
|
3
|
+
import { interpolateTemplate } from "./utils.js";
|
|
4
4
|
/**
|
|
5
5
|
* Builder for data-driven tests with multi-step workflow support.
|
|
6
6
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"each-builder.js","sourceRoot":"","sources":["../../src/test/each-builder.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,OAAO,WAAW;IAKd,SAAS,CAAW;IACpB,MAAM,CAAe;IACrB,MAAM,CAAgC;IACtC,SAAS,CAAmC;IAE5C,MAAM,GAA4D,EAAE,CAAC;IACrE,MAAM,GAAG,KAAK,CAAC;IACf,SAAS,CAAU;IAE3B,SAAS,CAAoC;IAE7C;;OAEG;IACM,cAAc,GAAG,cAAuB,CAAC;IAElD,YACE,QAAkB,EAClB,KAAmB,EACnB,QAA2C,EAC3C,QAAQ,GAAG,KAAK;QAEhB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,0DAA0D;QAC1D,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;OASG;IACH,IAA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,IAAI,CAAC,SAAS,CAAC;YAEhC,OAAO;gBACL,IAAI;gBACJ,IAAI,EAAE,OAAgB;gBACtB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,GAAgB,EAAE,EAAE,CAAC,KAAK,CAAC,GAAU,EAAE,GAAG,CAAC,CAAsB,CAAC,CAAC,CAAC,SAAS;gBAC/F,QAAQ,EAAE,QAAQ;oBAChB,CAAC,CAAE,CAAC,CAAC,GAAgB,EAAE,KAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAU,EAAE,KAAK,EAAE,GAAG,CAAC,CAAyB;oBAC7F,CAAC,CAAC,SAAS;gBACb,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC7B,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,EAAE,EAAE,CAAC,CAAC,GAAgB,EAAE,KAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAU,EAAE,KAAK,EAAE,GAAG,CAAC,CAAoB;iBACtF,CAAC,CAAC;gBACH,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACxD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* Supports chained `.extend()`, `.each()`, and `.pick()`.
|
|
9
9
|
* Also exports the `ExtendedTest` interface and `EachOptions`.
|
|
10
10
|
*/
|
|
11
|
-
import type { ExtensionFn, ResolveExtensions, Test, TestContext, TestMeta } from "
|
|
12
|
-
import { TestBuilder } from "./
|
|
11
|
+
import type { ExtensionFn, ResolveExtensions, Test, TestContext, TestMeta } from "../types.js";
|
|
12
|
+
import { TestBuilder } from "./builder.js";
|
|
13
13
|
import { EachBuilder } from "./each-builder.js";
|
|
14
14
|
/** Keys that cannot be used as extension names (they shadow core TestContext). */
|
|
15
15
|
export declare const EXTEND_RESERVED_KEYS: Set<string>;
|
|
@@ -56,4 +56,4 @@ export interface EachOptions {
|
|
|
56
56
|
* @internal
|
|
57
57
|
*/
|
|
58
58
|
export declare function createExtendedTest<Ctx extends TestContext>(allFixtures: Record<string, ExtensionFn<any>>): ExtendedTest<Ctx>;
|
|
59
|
-
//# sourceMappingURL=
|
|
59
|
+
//# sourceMappingURL=extend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../src/test/extend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EAEjB,IAAI,EACJ,WAAW,EACX,QAAQ,EACT,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,aAAuC,CAAC;AAEzE;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY,CAAC,GAAG,SAAS,WAAW;IACnD,+DAA+D;IAC/D,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACrE,4DAA4D;IAC5D,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEhE;;;OAGG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,EACnD,UAAU,EAAE,CAAC,GACZ,YAAY,CAAC,GAAG,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5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