mix ymer_node.browser_check (Ymer Node v0.5.0)

Copy Markdown View Source

Runs the browser service's own tests — node --test in browser-service/, against the real Chromium its pinned Playwright drives.

Usage

mix ymer_node.browser_check

No options and no arguments. The node's suite tests its side of the wire through Req.Test, with no browser; these tests are the service's side, so mix precommit runs both and one gate covers the whole contract.

What it runs

npm ci first, whenever browser-service/node_modules is missing or older than package-lock.json — a fresh clone, or a commit that moved the Playwright pin — which installs the locked packages and, through the package's postinstall, the browser builds they drive. Then npm test. Neither touches the storage states a person keeps: every test works in a directory of its own under the system's temporary directory, and every server a test starts listens on a port the system picks.

It needs Node.js, and refuses by name when npm is not on the PATH. A Playwright whose browser build is missing fails its first test with the instruction that fixes it.

The module is wrapped in if Mix.env() in [:dev, :test], like mix ymer_node.consumer_check, so a consumer's build of the node never contains it.