// ============================================================ // ASSISTANT VOICE MODE // ============================================================ // The hands-free overlay: tap, speak, hear the answer. Two things about it were // wrong in ways a person notices immediately. const test = require('node:test'); const assert = require('node:assert'); const fs = require('fs'); const path = require('path'); const read = p => fs.readFileSync(path.join(__dirname, '..', p), 'utf8'); const src = read('public/js/clinicalAssistant.js'); // The function under test is a closure inside a browser IIFE, so it is pulled // out by source rather than imported. const speakableText = (() => { const from = src.indexOf('function speakableText'); const to = src.indexOf('function speakAnswerVoice'); // eslint-disable-next-line no-eval return eval(src.slice(from, to) + '; speakableText'); })(); test('ending the call stops the voice', () => { // It stopped listening and aborted the request but never stopped playback, // and the