@jterrazz/test 3.3.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -73
- package/dist/index.cjs +240 -4357
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +137 -4276
- package/dist/index.js.map +1 -1
- package/package.json +12 -8
- package/dist/assets/cpufeatures-B-FC6C9Z.node +0 -0
- package/dist/assets/sshcrypto-D82met6T.node +0 -0
- package/dist/build.cjs +0 -122200
- package/dist/build.cjs.map +0 -1
- package/dist/build.js +0 -122193
- package/dist/build.js.map +0 -1
- package/dist/chunk.cjs +0 -64
- package/dist/chunk.js +0 -37
- package/dist/dist.cjs +0 -6587
- package/dist/dist.cjs.map +0 -1
- package/dist/dist.js +0 -6582
- package/dist/dist.js.map +0 -1
- package/dist/dist2.cjs +0 -20838
- package/dist/dist2.cjs.map +0 -1
- package/dist/dist2.js +0 -20834
- package/dist/dist2.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -79,7 +79,8 @@ declare class Orchestrator {
|
|
|
79
79
|
constructor(options: OrchestratorOptions);
|
|
80
80
|
/**
|
|
81
81
|
* Start declared services via testcontainers (integration mode).
|
|
82
|
-
*
|
|
82
|
+
* Phase 1: start all containers in parallel (the slow part).
|
|
83
|
+
* Phase 2: wire connections, healthcheck, and init sequentially (fast).
|
|
83
84
|
*/
|
|
84
85
|
start(): Promise<void>;
|
|
85
86
|
/**
|
|
@@ -118,6 +119,15 @@ interface CommandResult {
|
|
|
118
119
|
stdout: string;
|
|
119
120
|
stderr: string;
|
|
120
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Options for spawning a long-running process.
|
|
124
|
+
*/
|
|
125
|
+
interface SpawnOptions {
|
|
126
|
+
/** Resolve when stdout/stderr contains this string. */
|
|
127
|
+
waitFor: string;
|
|
128
|
+
/** Kill the process after this many milliseconds. */
|
|
129
|
+
timeout: number;
|
|
130
|
+
}
|
|
121
131
|
/**
|
|
122
132
|
* Abstract CLI interface for specification runners.
|
|
123
133
|
* Implement this to plug in your command execution strategy.
|
|
@@ -125,6 +135,8 @@ interface CommandResult {
|
|
|
125
135
|
interface CommandPort {
|
|
126
136
|
/** Execute a CLI command with the given arguments in the given working directory. */
|
|
127
137
|
exec(args: string, cwd: string): Promise<CommandResult>;
|
|
138
|
+
/** Spawn a long-running process and wait for a pattern or timeout. */
|
|
139
|
+
spawn(args: string, cwd: string, options: SpawnOptions): Promise<CommandResult>;
|
|
128
140
|
}
|
|
129
141
|
//#endregion
|
|
130
142
|
//#region src/specification/ports/server.port.d.ts
|
|
@@ -200,6 +212,7 @@ declare class SpecificationBuilder {
|
|
|
200
212
|
private projectName;
|
|
201
213
|
private request;
|
|
202
214
|
private seeds;
|
|
215
|
+
private spawnConfig;
|
|
203
216
|
private testDir;
|
|
204
217
|
constructor(config: SpecificationConfig, testDir: string, label: string);
|
|
205
218
|
seed(file: string, options?: {
|
|
@@ -212,7 +225,8 @@ declare class SpecificationBuilder {
|
|
|
212
225
|
post(path: string, bodyFile?: string): this;
|
|
213
226
|
put(path: string, bodyFile?: string): this;
|
|
214
227
|
delete(path: string): this;
|
|
215
|
-
exec(args: string): this;
|
|
228
|
+
exec(args: string | string[]): this;
|
|
229
|
+
spawn(args: string, options: SpawnOptions): this;
|
|
216
230
|
run(): Promise<SpecificationResult>;
|
|
217
231
|
private prepareWorkDir;
|
|
218
232
|
private runHttpAction;
|
|
@@ -237,6 +251,7 @@ declare class PostgresHandle implements DatabasePort, ServiceHandle {
|
|
|
237
251
|
readonly environment: Record<string, string>;
|
|
238
252
|
connectionString: string;
|
|
239
253
|
started: boolean;
|
|
254
|
+
private client;
|
|
240
255
|
constructor(options?: PostgresOptions);
|
|
241
256
|
buildConnectionString(host: string, port: number): string;
|
|
242
257
|
createDatabaseAdapter(): DatabasePort;
|
|
@@ -289,13 +304,14 @@ declare function redis(options?: RedisOptions): RedisHandle;
|
|
|
289
304
|
//#endregion
|
|
290
305
|
//#region src/specification/adapters/exec.adapter.d.ts
|
|
291
306
|
/**
|
|
292
|
-
* Executes CLI commands via execSync.
|
|
307
|
+
* Executes CLI commands via execSync (blocking) or spawn (long-running).
|
|
293
308
|
* Used by cli() for local command execution.
|
|
294
309
|
*/
|
|
295
310
|
declare class ExecAdapter implements CommandPort {
|
|
296
311
|
private command;
|
|
297
312
|
constructor(command: string);
|
|
298
313
|
exec(args: string, cwd: string): Promise<CommandResult>;
|
|
314
|
+
spawn(args: string, cwd: string, options: SpawnOptions): Promise<CommandResult>;
|
|
299
315
|
}
|
|
300
316
|
//#endregion
|
|
301
317
|
//#region src/specification/adapters/fetch.adapter.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -79,7 +79,8 @@ declare class Orchestrator {
|
|
|
79
79
|
constructor(options: OrchestratorOptions);
|
|
80
80
|
/**
|
|
81
81
|
* Start declared services via testcontainers (integration mode).
|
|
82
|
-
*
|
|
82
|
+
* Phase 1: start all containers in parallel (the slow part).
|
|
83
|
+
* Phase 2: wire connections, healthcheck, and init sequentially (fast).
|
|
83
84
|
*/
|
|
84
85
|
start(): Promise<void>;
|
|
85
86
|
/**
|
|
@@ -118,6 +119,15 @@ interface CommandResult {
|
|
|
118
119
|
stdout: string;
|
|
119
120
|
stderr: string;
|
|
120
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Options for spawning a long-running process.
|
|
124
|
+
*/
|
|
125
|
+
interface SpawnOptions {
|
|
126
|
+
/** Resolve when stdout/stderr contains this string. */
|
|
127
|
+
waitFor: string;
|
|
128
|
+
/** Kill the process after this many milliseconds. */
|
|
129
|
+
timeout: number;
|
|
130
|
+
}
|
|
121
131
|
/**
|
|
122
132
|
* Abstract CLI interface for specification runners.
|
|
123
133
|
* Implement this to plug in your command execution strategy.
|
|
@@ -125,6 +135,8 @@ interface CommandResult {
|
|
|
125
135
|
interface CommandPort {
|
|
126
136
|
/** Execute a CLI command with the given arguments in the given working directory. */
|
|
127
137
|
exec(args: string, cwd: string): Promise<CommandResult>;
|
|
138
|
+
/** Spawn a long-running process and wait for a pattern or timeout. */
|
|
139
|
+
spawn(args: string, cwd: string, options: SpawnOptions): Promise<CommandResult>;
|
|
128
140
|
}
|
|
129
141
|
//#endregion
|
|
130
142
|
//#region src/specification/ports/server.port.d.ts
|
|
@@ -200,6 +212,7 @@ declare class SpecificationBuilder {
|
|
|
200
212
|
private projectName;
|
|
201
213
|
private request;
|
|
202
214
|
private seeds;
|
|
215
|
+
private spawnConfig;
|
|
203
216
|
private testDir;
|
|
204
217
|
constructor(config: SpecificationConfig, testDir: string, label: string);
|
|
205
218
|
seed(file: string, options?: {
|
|
@@ -212,7 +225,8 @@ declare class SpecificationBuilder {
|
|
|
212
225
|
post(path: string, bodyFile?: string): this;
|
|
213
226
|
put(path: string, bodyFile?: string): this;
|
|
214
227
|
delete(path: string): this;
|
|
215
|
-
exec(args: string): this;
|
|
228
|
+
exec(args: string | string[]): this;
|
|
229
|
+
spawn(args: string, options: SpawnOptions): this;
|
|
216
230
|
run(): Promise<SpecificationResult>;
|
|
217
231
|
private prepareWorkDir;
|
|
218
232
|
private runHttpAction;
|
|
@@ -237,6 +251,7 @@ declare class PostgresHandle implements DatabasePort, ServiceHandle {
|
|
|
237
251
|
readonly environment: Record<string, string>;
|
|
238
252
|
connectionString: string;
|
|
239
253
|
started: boolean;
|
|
254
|
+
private client;
|
|
240
255
|
constructor(options?: PostgresOptions);
|
|
241
256
|
buildConnectionString(host: string, port: number): string;
|
|
242
257
|
createDatabaseAdapter(): DatabasePort;
|
|
@@ -289,13 +304,14 @@ declare function redis(options?: RedisOptions): RedisHandle;
|
|
|
289
304
|
//#endregion
|
|
290
305
|
//#region src/specification/adapters/exec.adapter.d.ts
|
|
291
306
|
/**
|
|
292
|
-
* Executes CLI commands via execSync.
|
|
307
|
+
* Executes CLI commands via execSync (blocking) or spawn (long-running).
|
|
293
308
|
* Used by cli() for local command execution.
|
|
294
309
|
*/
|
|
295
310
|
declare class ExecAdapter implements CommandPort {
|
|
296
311
|
private command;
|
|
297
312
|
constructor(command: string);
|
|
298
313
|
exec(args: string, cwd: string): Promise<CommandResult>;
|
|
314
|
+
spawn(args: string, cwd: string, options: SpawnOptions): Promise<CommandResult>;
|
|
299
315
|
}
|
|
300
316
|
//#endregion
|
|
301
317
|
//#region src/specification/adapters/fetch.adapter.d.ts
|