mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-01 12:02:05 +00:00
test(whatsapp-bridge): drop structural send-queue integration test
The .integration.test.mjs greps bridge.js source text for the queue wiring — a change-detector that breaks on any benign refactor of the same code. The behavioral unit test (bridge.sendqueue.test.mjs) already covers FIFO ordering, error isolation, timeout propagation, and single-consumer concurrency, which is the contract that matters.
This commit is contained in:
parent
c393a8e55f
commit
cb9f855c2b
1 changed files with 0 additions and 29 deletions
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* Integration test: verify bridge.js has the send queue wired in.
|
||||
* This reads the source file and asserts the required patterns exist.
|
||||
*/
|
||||
import { strict as assert } from 'node:assert';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const src = readFileSync(resolve(__dirname, 'bridge.js'), 'utf-8');
|
||||
|
||||
// 1. Queue primitives exist
|
||||
assert.ok(src.includes('let _sendQueue = Promise.resolve()'),
|
||||
'bridge.js must define _sendQueue');
|
||||
assert.ok(src.includes('function enqueueSend(fn)'),
|
||||
'bridge.js must define enqueueSend');
|
||||
|
||||
// 2. sendWithTimeout is wrapped
|
||||
assert.ok(src.includes('return enqueueSend(() =>'),
|
||||
'sendWithTimeout must call enqueueSend');
|
||||
|
||||
// 3. The queue is before sendWithTimeout in the file
|
||||
const queueIdx = src.indexOf('let _sendQueue');
|
||||
const sendTimeoutIdx = src.indexOf('function sendWithTimeout');
|
||||
assert.ok(queueIdx < sendTimeoutIdx,
|
||||
'_sendQueue must be defined before sendWithTimeout');
|
||||
|
||||
console.log('✅ bridge.js send queue integration check passed.');
|
||||
Loading…
Add table
Add a link
Reference in a new issue