Testing
Unit tests
npm test
Game-specific tests live in test/games/. Good unit tests will save future you (and future maintainers) a lot of headaches. No need to test basic stuff tested elsewhere (like graph/grid functions), but it's wise to test end-of-game resolution and any edge cases. See existing tests for patterns.
CLI example
bin/example.ts — run moves from the command line:
npx ts-node bin/example.ts <uid> [moves...]
Browser playground
The standalone gameslib playground is not part of the docs site:
To run locally you need:
- A local web server (LAMP or similar)
playground/playground.*APRender.min.jsfrom renderer playground ornpm run dist-devin rendererAPGames.min.jsfromnpm run dist-devin gameslib
Renderer output
Prototype board JSON at renderer.dev.abstractplay.com before wiring render() in your game.
Example games
- Complica tests — grep
complicaundertest/games/