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:
parent
cd6350e0b1
commit
365b2c4d13
|
|
@ -29,6 +29,7 @@
|
|||
"scripts": {
|
||||
"build": "tsup",
|
||||
"dev": "tsup --watch",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest run",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@
|
|||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
"include": ["src", "test", "examples"],
|
||||
"exclude": ["node_modules", "dist"],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue