comfyui-node 1.6.4 → 1.6.5
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 +71 -9
- package/dist/.tsbuildinfo +1 -1
- package/dist/call-wrapper.d.ts.map +1 -1
- package/dist/call-wrapper.js +859 -856
- package/dist/call-wrapper.js.map +1 -1
- package/dist/client.d.ts +27 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +87 -6
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/multipool/multi-workflow-pool.d.ts.map +1 -1
- package/dist/multipool/multi-workflow-pool.js +61 -30
- package/dist/multipool/multi-workflow-pool.js.map +1 -1
- package/dist/pool/WorkflowPool.d.ts.map +1 -1
- package/dist/pool/WorkflowPool.js +855 -845
- package/dist/pool/WorkflowPool.js.map +1 -1
- package/dist/pool/client/ClientManager.js +215 -215
- package/dist/pool/index.js +3 -3
- package/dist/pool/types/job.d.ts +15 -0
- package/dist/pool/types/job.d.ts.map +1 -1
- package/dist/types/event.d.ts +17 -1
- package/dist/types/event.d.ts.map +1 -1
- package/dist/utils/model-loading.d.ts +158 -0
- package/dist/utils/model-loading.d.ts.map +1 -0
- package/dist/utils/model-loading.js +273 -0
- package/dist/utils/model-loading.js.map +1 -0
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -186,12 +186,14 @@ const results = await pool.waitForJobCompletion(sdxlJobId);
|
|
|
186
186
|
console.log("SDXL Job completed!", results.images);
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
## What's New in v1.5
|
|
189
|
+
## What's New in v1.6.5
|
|
190
190
|
|
|
191
|
-
- **
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
191
|
+
- **Integration Test Infrastructure** – Comprehensive reconnection testing with real mock server processes
|
|
192
|
+
- Mock servers spawn in separate OS processes that can be killed/restarted
|
|
193
|
+
- 13 integration tests covering manual/auto-reconnection, state transitions, and multiple restart cycles
|
|
194
|
+
- Test helpers and utilities for easy test development
|
|
195
|
+
- 900+ lines of documentation with quick-start guide and examples
|
|
196
|
+
- Run with: `bun test test/integration/` or `bun run test:integration`
|
|
195
197
|
|
|
196
198
|
See [CHANGELOG.md](./CHANGELOG.md) for complete release notes.
|
|
197
199
|
|
|
@@ -250,11 +252,71 @@ job.on('failed', err => console.error(err));
|
|
|
250
252
|
|
|
251
253
|
## Testing
|
|
252
254
|
|
|
255
|
+
### Unit and Integration Tests
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
bun test # Unit + integration tests
|
|
259
|
+
bun run test:integration # Run all integration tests
|
|
260
|
+
bun run test:integration:simple # Run simple reconnection examples
|
|
261
|
+
bun run test:real # Real server tests (COMFY_REAL=1)
|
|
262
|
+
bun run test:full # Comprehensive tests (COMFY_FULL=1)
|
|
263
|
+
bun run coverage # Coverage report
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Integration Tests (v1.6.5+)
|
|
267
|
+
|
|
268
|
+
The library includes a comprehensive integration test infrastructure that spawns real mock server processes to test reconnection behavior:
|
|
269
|
+
|
|
253
270
|
```bash
|
|
254
|
-
|
|
255
|
-
bun
|
|
256
|
-
|
|
257
|
-
|
|
271
|
+
# Run all integration tests
|
|
272
|
+
bun test test/integration/
|
|
273
|
+
|
|
274
|
+
# Run simple examples (recommended first)
|
|
275
|
+
bun run test:integration:simple
|
|
276
|
+
|
|
277
|
+
# Validate the mock server infrastructure
|
|
278
|
+
bun test/integration/validate-mock-server.ts
|
|
279
|
+
|
|
280
|
+
# Debug: Run mock server standalone
|
|
281
|
+
bun test/integration/mock-server.ts 8191
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**What's Tested:**
|
|
285
|
+
- Manual and automatic reconnection after server crashes
|
|
286
|
+
- Connection state transitions (connecting → connected → disconnected → reconnecting)
|
|
287
|
+
- Event emission (`reconnected`, `reconnection_failed`)
|
|
288
|
+
- Multiple server restart cycles
|
|
289
|
+
- WebSocket message handling across reconnections
|
|
290
|
+
|
|
291
|
+
**Documentation:**
|
|
292
|
+
- `test/integration/README.md` – Comprehensive guide
|
|
293
|
+
- `test/integration/QUICKSTART.md` – Developer quick-start with patterns
|
|
294
|
+
- `test/integration/SUMMARY.md` – Architecture overview
|
|
295
|
+
|
|
296
|
+
**Example:**
|
|
297
|
+
```ts
|
|
298
|
+
// Integration test pattern
|
|
299
|
+
const manager = new ServerManager({ port: 8191 });
|
|
300
|
+
await manager.startServer(8191);
|
|
301
|
+
|
|
302
|
+
const api = new ComfyApi("http://localhost:8191");
|
|
303
|
+
await initializeClient(api);
|
|
304
|
+
|
|
305
|
+
// Kill server to simulate crash
|
|
306
|
+
await manager.killServer(8191);
|
|
307
|
+
await sleep(500);
|
|
308
|
+
|
|
309
|
+
// Restart server
|
|
310
|
+
await manager.startServer(8191);
|
|
311
|
+
|
|
312
|
+
// Verify reconnection
|
|
313
|
+
await api.reconnectWs(true);
|
|
314
|
+
await waitForConnection(api);
|
|
315
|
+
expect(api.isConnected()).toBe(true);
|
|
316
|
+
|
|
317
|
+
// Cleanup
|
|
318
|
+
api.destroy();
|
|
319
|
+
await manager.killAll();
|
|
258
320
|
```
|
|
259
321
|
|
|
260
322
|
See [Troubleshooting docs](./docs/troubleshooting.md#testing--coverage) for details.
|