Harden sortie item save recovery
This commit is contained in:
@@ -81,7 +81,9 @@ try {
|
||||
sortieFormationAssignments: 'front',
|
||||
sortieItemAssignments: {
|
||||
'liu-bei': { bean: '2', wine: -1 },
|
||||
'guan-yu': 'broken'
|
||||
'guan-yu': '2',
|
||||
'zhang-fei': ['bean', '2'],
|
||||
'': { bean: 4 }
|
||||
},
|
||||
battleHistory: []
|
||||
})
|
||||
@@ -109,6 +111,9 @@ try {
|
||||
malformed.inventory.wine === undefined &&
|
||||
malformed.sortieItemAssignments['liu-bei']?.bean === 2 &&
|
||||
malformed.sortieItemAssignments['liu-bei']?.wine === undefined &&
|
||||
malformed.sortieItemAssignments['guan-yu'] === undefined &&
|
||||
malformed.sortieItemAssignments['zhang-fei'] === undefined &&
|
||||
Object.keys(malformed.sortieItemAssignments).length === 1 &&
|
||||
Object.keys(malformed.sortieFormationAssignments).length === 0,
|
||||
`Expected malformed inventory and sortie assignments to normalize: ${JSON.stringify(malformed)}`
|
||||
);
|
||||
@@ -258,7 +263,7 @@ try {
|
||||
const fallback = loadCampaignState();
|
||||
assert(fallback.step === 'second-camp' && fallback.activeSaveSlot === 2, `Expected valid slotted save fallback: ${JSON.stringify(fallback)}`);
|
||||
|
||||
console.log('Verified campaign save normalization, malformed-field/bond/history-detail recovery, unknown-step/report/history recovery, unsupported-version rejection, and slotted fallback.');
|
||||
console.log('Verified campaign save normalization, malformed-field/bond/sortie-item/history-detail recovery, unknown-step/report/history recovery, unsupported-version rejection, and slotted fallback.');
|
||||
} finally {
|
||||
await server.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user