import test from 'node:test'; import assert from 'node:assert/strict'; import {createModeration} from '../control-panel/moderation.mjs'; test('moderation sync rejects an invalid empty ban feed without mutating history',async()=>{let writes=0;const db={prepare(){writes++;throw Error('must not write')}};const moderation=createModeration(db,{SERVER_CONTROL_TOKEN:'x'},{fetcher:async()=>Response.json({bans:[],sources:[]})});await assert.rejects(moderation.sync(),/Invalid ban sources/);assert.equal(writes,0);});