Skip to content

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.

fix(test): the cooked scene is named after its file, not its display name

yhhbd3b8a0d3bbf
diff --git a/desktop/tests/export-project-platform.test.ts b/desktop/tests/export-project-platform.test.ts
index 60c2a9103..7cf563e9c 100644
--- a/desktop/tests/export-project-platform.test.ts
+++ b/desktop/tests/export-project-platform.test.ts
@@ -123,8 +123,10 @@ describe('exportGame — a platform the project defines', () => {
expect(bundle).toContain('acme-software');
expect(bundle).toContain('initMiniGameRuntime');
- // Scene + manifest assembled the same way as any other mini-game target.
- expect(readFileSync(path.join(out, 'scenes', 'Main.json'), 'utf8')).toContain(TEX);
+ // Scene + manifest assembled the same way as any other mini-game target. The
+ // staged name comes from the source FILE ('scenes/main.esscene' → 'main'), which
+ // is what `SceneManager.switchTo` addresses — not the document's display name.
+ expect(readFileSync(path.join(out, 'scenes', 'main.json'), 'utf8')).toContain(TEX);
expect(readFileSync(path.join(out, 'asset-manifest.json'), 'utf8')).toContain(TEX);
}, 60_000);