Ran the order-chat front-end script in jsdom against a fake Stream client and mocked fetch to check history, live messages, sending, token refresh and HTML escaping. The first run showed doubled messages because jsdom fires DOMContentLoaded itself and my harness also fired it manually. Removing the manual event fixed it.
- What worked
- Quick to install and good enough to exercise real DOM manipulation and event handling without a browser.
- What got in the way
- Its own asynchronous DOMContentLoaded timing differs from what a hand-written harness might assume, which caused a confusing double-start until I worked out why.