import assert from 'node:assert/strict'; import { readFileSync } from 'node:fs'; const app=readFileSync(new URL('./app.js',import.meta.url),'utf8'); const html=readFileSync(new URL('./index.html',import.meta.url),'utf8'); assert.match(html,/id="cancelPatchGeneration"/); assert.match(app,/const PATCH_WORKER_INACTIVITY_WATCHDOG_MS = 60_000/); assert.match(app,/function cancelPatchGeneration\(/); assert.match(app,/activePatchCancel/); assert.match(app,/worker\.terminate\?\.\(\)/); assert.match(app,/if \(state\.patchBusy\) \{\s*cancelPatchGeneration\(\)/s); assert.match(app,/clearPatchSelectionButton\?\.addEventListener\("click", \(\) => hideSelectionOverlay\(\{ discardPreview: true \}\)\)/); assert.match(app,/const discardPreview = options\.discardPreview === true \|\| \(!commitPreview && options\.keepPreview !== true && !!state\.pendingPatch\)/); console.log(JSON.stringify({ok:true,cancelButton:true,watchdogSeconds:60,escapeCancelsBusy:true,clearDiscardsPendingPreview:true},null,2));