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.

test(wechat): the package's own bundle installs a platform

esenginee1e14857eb18
diff --git a/pipeline/tests/export-wechat.test.ts b/pipeline/tests/export-wechat.test.ts
index de18c4eac..ece0a3e15 100644
--- a/pipeline/tests/export-wechat.test.ts
+++ b/pipeline/tests/export-wechat.test.ts
@@ -108,6 +108,13 @@ describe('exportGame (wechat)', () => {
expect(bundle).toContain('wasm/esengine.wasm');
// The project camera fit rides the boot config into initWeChatRuntime.
expect(bundle).toContain('screenFit');
+ // The platform is INSTALLED by a call the entry makes, not by an SDK module's
+ // top-level statement: when the install sat in a shared chunk that
+ // `sideEffects` did not name, the bundler dropped it and every package threw
+ // "Platform not initialized" on its first frame.
+ const { platformInit } = wechatExportProfile;
+ expect(platformInit, 'the profile must name how the platform is installed').toBeTruthy();
+ expect(bundle).toContain(`${platformInit}()`);
expect(bundle).toMatch(/"scaleMode":\s*2/);
// Same generated boot carries the 2.5D opt-in — one packaged slice, so a
// setting cannot reach one target and not another.