import test from 'node:test'; import assert from 'node:assert/strict'; import { injectPublicImageRetryScript, publicImageRetryInternals, } from './mindspace-public-image-retry.mjs'; test('injectPublicImageRetryScript injects retry script before ', () => { const result = injectPublicImageRetryScript('

Hi

'); assert.match(result.html, /data-mindspace-image-retry="1"/); assert.match(result.html, /addEventListener\('error'/); assert.match(result.html, /mindspace\\\/v1\\\/assets/); assert.match(result.html, /stopImmediatePropagation/); assert.equal(result.html.indexOf('data-mindspace-image-retry'), result.html.lastIndexOf('data-mindspace-image-retry')); assert.match(result.html, /