The loader keeps no migrations any more: an asset of the old type autotile (before #131) is an unknown type and dropped, and a tilemap layer with the cell map of the first version (before #134) loads empty; every project is saved in the current format, and the two tests now pin that the old shapes are not read (#137)
game-maker / gate (push) Successful in 1m49s
game-maker / suite (push) Successful in 6m19s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-18 15:12:07 +02:00
1 parent bffa508ee7
commit c91c18f495
4 files changed
+13 -47

No files matched your search

+6 -11
View File
@@ -108,19 +108,14 @@ describe('the cells of a tilemap in the file', () => {
expect((findAsset(project, id) as TilemapAsset).layers[0]!.cells).toEqual(cells);
});
it('take a project saved before #134 over as it is, and write it in the new form', () => {
// No migration any more (#137): the map of the first version (#128) is not read.
it('read a layer holding the map itself as empty', () => {
const { project, id } = projectWith({});
const raw = serializeProject(project) as { assets: Record<string, unknown>[] };
const old = raw.assets.find((a) => a.id === id)!;
old.layers = [
{ id: 'L1', name: 'Ground', cells: { '1,2': 'grass', '2,2': 'grass', nonsense: 'x', '3,3': '' } },
];
const loaded = deserializeProject(raw);
expect((findAsset(loaded, id) as TilemapAsset).layers[0]!.cells).toEqual({
'1,2': 'grass',
'2,2': 'grass',
});
expect(storedLayer(serializeProject(loaded), id)).toMatchObject({ tiles: ['grass'], rows: ['1*2'] });
raw.assets.find((a) => a.id === id)!.layers = [{ id: 'L1', name: 'Ground', cells: { '1,2': 'grass' } }];
const layer = (findAsset(deserializeProject(raw), id) as TilemapAsset).layers[0]!;
expect(layer).toMatchObject({ id: 'L1', name: 'Ground' });
expect(layer.cells).toEqual({});
});
it('shrink a full map of 100 × 100 with two layers to a small part of the old size', () => {