Skip to content

Latest commit

 

History

History
8 lines (7 loc) · 2.29 KB

testing.md

File metadata and controls

8 lines (7 loc) · 2.29 KB

Testing

  • node --test test/server.test.mjs test/dial.test.mjs runs the two Node suites: the server (static serving and traversal, the feed proxy, the config API and its guards, a broken config told rather than hidden, weather and geocoding, the channels inventory across drives, durations, titles read from inside files, the tuner bus, the vitals, version, and power endpoints, the command line) and the broadcast clock (positions, schedules with overnight windows, the timeline with breaks, the guide grid and what it names, the dial, the volume cycle and the volume steps, and the counting of button presses).
  • Browser helpers: start the server and open http://localhost:1982/test/harness.html for the same dial math in a browser plus the DOM-bound helpers (feed parsing, sanitizing, the crawl text, the clock faces).
  • End to end: node test/e2e.mjs puts the real display in a headless Chromium on a throwaway config and drives it the way a living room does: signs on to the board, tunes the guide, plays a video channel through a file boundary, lands on a test card, presses volume and power, turns the dial from the keyboard, works a joystick (the stick for the dial and the volume, two presses for power, ten for the shutdown, with the request caught before it reaches a machine), saves from the control room and watches the set reload itself, asks the remote how many sets are listening, turns faux CRT on and checks the console, the glass, the dial, and the switch-off, and breaks config.json to see the set say so. It needs Playwright (not a dependency of the station: npm i playwright && npx playwright install chromium in a scratch folder, then run with NODE_PATH=<that>/node_modules) and ffmpeg for its two test clips (FFMPEG=<path> if it is not on the PATH). Without Playwright it says so and exits clean.
  • Tuner drill by hand: with more than one channel on the dial, curl -X POST http://localhost:1982/api/tune -H "content-type: application/json" -d "{\"cmd\":\"up\"}" and watch the display change channels - the whole bus in one command.
  • Failure drill: node server.js --chaos serves mock feeds that randomly hang and fail, so you can watch the Community Board shrug it off.
  • Soak: open http://localhost:1982/?soak=1 for accelerated channel-82 page flips and refreshes with stats logged to the console.