fix: handle edge object in serialization tests

Add `typecheck` script to package.json, expand tsconfig include
paths to cover tests and examples, and update serialization tests
to correctly resolve player IDs from relationship edges.
This commit is contained in:
2026-06-02 18:05:47 +08:00
parent cd6350e0b1
commit 365b2c4d13
3 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -277,7 +277,9 @@ describe("Serialization — complex state", () => {
const comps = snap.entities[id];
return comps.position && comps.velocity && !comps.health;
})!;
const playerId = snap.relationships.ownedBy[bulletId];
const playerEdge = snap.relationships.ownedBy[bulletId];
const playerId =
typeof playerEdge === "string" ? playerEdge : playerEdge.target;
// Player should have a name
const playerComps = snap.entities[playerId];