mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
Build test engines from the shared fake instead of literals
Tests that made their own engine object now use createFakeEngine() with its scripting hooks or an override of the one member under test, so they follow the contract when it changes. 125 such literals in 74 test files go down to two that are not globe engines on purpose; report-qa-harness counts them, and the baseline keeps the number from growing.
This commit is contained in:
1 parent
3c304502a0
commit
225c1c25c7
76 files changed
+668
-564
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { createFakeEngine } from '../globe/testing/fakeEngine.js';
|
||||
// The standalone application is created once; an engine switch detaches and
|
||||
// attaches only its engine-bound parts. A candidate that fails releases its
|
||||
// renderer, and the working engine attaches again on the same parts.
|
||||
@@ -48,7 +49,8 @@ function standalone({ failOpen = null, beforeOpen, beforeRelease, lifecycle = fa
|
||||
createStandaloneScene: async ({ engineKind, defer }) => {
|
||||
await beforeOpen?.(engineKind);
|
||||
if (failOpen === engineKind) throw new Error(`${engineKind} refused`);
|
||||
const engine = { kind: engineKind, id: opened.length };
|
||||
const engine = createFakeEngine({ kind: engineKind });
|
||||
engine.id = opened.length;
|
||||
opened.push(engine);
|
||||
defer(async () => {
|
||||
await beforeRelease?.(engine);
|
||||
|
||||
Reference in new issue
Block a user