# webgame-smoke

jsdom harness so the @jsdev grinder can DOM-smoke a single-file HTML canvas game headless.
Loads the HTML into jsdom with canvas-2d / requestAnimationFrame / Web-Audio shimmed, captures
uncaught errors, and exposes `tick(n)` to advance frames. A `.test.js` does:

```js
const { loadHtmlGame } = require('webgame-smoke');
const g = loadHtmlGame(__dirname + '/game.html'); g.tick(10);
assert.deepStrictEqual(g.errors, []);            // booted + ran clean
assert.ok(g.window.game && g.window.game.ship);  // game state initialised
```

## Deploy (grind host)
The grinder runs `node --test` in a network-less bwrap jail that can read only system paths,
so jsdom + this harness must live in the GLOBAL node_modules:

```sh
sudo npm install -g jsdom
sudo cp -r contrib/webgame-smoke /usr/lib/node_modules/webgame-smoke
```
The grinder sets `NODE_PATH=/usr/lib/node_modules` in the jail so both resolve.
