A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
test(terrain): the layer-array refill harness types its adopt mock, so the SDK test typecheck reads its calls
yhh3246b9032443
diff --git a/sdk/tests/terrain-layer-arrays-refill.test.ts b/sdk/tests/terrain-layer-arrays-refill.test.tsindex 43c31c115..1e8d70087 100644--- a/sdk/tests/terrain-layer-arrays-refill.test.ts+++ b/sdk/tests/terrain-layer-arrays-refill.test.ts@@ -23,7 +23,7 @@ function engine() {content.set(handle, c);return handle;}),- adoptTextureContent: vi.fn(() => true),+ adoptTextureContent: vi.fn((_into: number, _from: number) => true),releaseTexture: vi.fn(),};initResourceManager(rm as unknown as CppResourceManager);@@ -49,7 +49,7 @@ describe('terrain layer arrays after a device loss', () => {for (const h of handles) expect(await textureRefill(h)!()).toBe(true);expect(repack).toHaveBeenCalledTimes(loss);expect(rm.adoptTextureContent.mock.calls.map(([into]) => into)).toEqual(handles);- for (const [, fresh] of rm.adoptTextureContent.mock.calls as unknown as Array<[number, number]>) {+ for (const [, fresh] of rm.adoptTextureContent.mock.calls) {expect(content.get(fresh)).toBe(TextureContent.Transient);expect(rm.releaseTexture).toHaveBeenCalledWith(fresh);}