Tests, CHANGELOG and docs for the peering desk

This commit is contained in:
Frederic Jung 2026-10-29 21:41:28 +01:00
parent 9ba7f197f1
commit 92536606dd
No known key found for this signature in database
16 changed files with 266 additions and 280 deletions

View file

@ -200,15 +200,14 @@ test('a peer at a rival exchange can de-peer you without stopping the game', ()
assert.deepEqual(errors, []);
});
test('an IX meltdown at a rival exchange names the city, and a failing day tick does not stop the game', () => {
test('an IX meltdown at a rival exchange names it, and a failing day tick does not stop the game', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e8;ACT.buildPop({city:'ams'});ACT.buyIx({city:'ams~2',tier:1});S.day=100");
const src = ev('fireFailure.toString()').replace(/^function fireFailure/, 'function')
.replace('let tot=opts.reduce', "opts.splice(0,opts.length,['funny',1]);let tot=opts.reduce")
.replace('type=pick(f);}', "type='maxpfx';}");
.replace('let tot=opts.reduce', "opts.splice(0,opts.length,['ixloop',1]);let tot=opts.reduce");
ev('window.__ff=' + src);
ev('__ff()');
assert.match(ev("S.inc.find(i=>i.type==='maxpfx').msg"), /in Amsterdam, is down/);
assert.ok(ev("S.inc.find(i=>i.type==='ixloop').msg.includes(ixName('ams~2'))"));
// a tick that throws is caught, reported once, and the loop keeps going
ev("const dt0=dayTick;window.dayTick=()=>{throw new Error('boom')};UI.speed=1;acc=DAY_MS;last=0;frame(16);window.dayTick=dt0");
assert.equal(ev('UI.tickErr'), true);