import assert from 'node:assert/strict'; import { readFileSync } from 'node:fs'; import test from 'node:test'; test('sending a message lives in one hook', () => { const app = readFileSync(new URL('../App.tsx', import.meta.url), 'utf8'); const hook = readFileSync(new URL('./useSendMessage.ts', import.meta.url), 'utf8'); assert.equal((app.match(/useSendMessage\(/g) || []).length, 1); assert.equal(app.includes('附件服务端注册失败'), false); assert.equal(hook.includes('registerUploadAttachments'), true); assert.equal(hook.includes('runTaskAttempt'), true); assert.equal(hook.includes('runStreamAttempt'), true); assert.equal(hook.includes('失败硬拦'), true); assert.equal(hook.includes('handlePassReview'), true); });