Add regression tests for #704 and #705 (#1060)

Covers the icon_size default of 64 in the export icon loaders and the
host recreating saves and script-output when an instance is assigned.
Both tests fail when the original fix is reverted.

Closes #710

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BastiaanandClaude Opus 5.5 authored and GitHub committed 2026-10-08 20:57:00 +01:00
1 parent 839f9eb56c
commit ae6e25d1b9
4 files changed
+78 -10

No files matched your search

+4 -2
View File
@@ -160,7 +160,7 @@ async function loadSimpleIcon(
item: SimpleIconSpecification,
size: number,
iconCache: IconCache,
) {
): Promise<Image | null> {
let icon = await loadIcon(server, modVersions, item.icon, item.icon_size ?? 64, 0, iconCache);
if (icon) {
let iconScale = size / (item.icon_size ?? 64);
@@ -178,7 +178,7 @@ async function loadLayeredIcon(
item: LayeredIconSpecification,
size: number,
iconCache: IconCache,
) {
): Promise<Image> {
let baseLayerSize = (item.icons[0].icon_size || item.icon_size) ?? 64;
let icon = new Jimp({ width: size, height: size });
@@ -590,3 +590,5 @@ export async function exportData(server: FactorioServer) {
// For testing only
export const _exportLocale = exportLocale;
export const _loadSimpleIcon = loadSimpleIcon;
export const _loadLayeredIcon = loadLayeredIcon;