Alex2Node/test/helpers
David 8379a65d78 examples: one runnable file per recipe on the 2.0 API, the 1.x files in examples/legacy
Ten recipes: lamp, colour lamp, thermostat, blind, lock (deferred), contact
sensor (ChangeReport), scene, doorbell (raise), typed errors, and a plug as an
ES module. Each reads ALEX2MQTT_USERNAME, _PASSWORD and _ROOT_TOPIC and names
the ones that are missing. The nine examples of 1.5.2 move to examples/legacy
unchanged.

test/examples.test.js starts every file with node, its broker connection sent
to a broker on 127.0.0.1 (test/helpers/loopback.js), discovers the device,
sends directives and checks the answers. A legacy file is started and its
discovery compared with the answer the 1.5.2 build gave, recorded in
test/fixtures/legacy-examples.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 21:38:07 +00:00
..
endpoint.js bridge: publish through a Publisher; devices no longer hold the broker client 2026-09-28 19:34:39 +00:00
examples.js examples: one runnable file per recipe on the 2.0 API, the 1.x files in examples/legacy 2026-09-28 21:38:07 +00:00
fixtures.js discovery: generate capability JSON from the registry 2026-09-28 15:35:46 +00:00
harness.js test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
loopback.js examples: one runnable file per recipe on the 2.0 API, the 1.x files in examples/legacy 2026-09-28 21:38:07 +00:00