These scripts run executables in Node.js without a browser, using mock Canvas/OffscreenCanvas objects. They verify that the emulator can load a binary and reach the Windows message loop (= the program initialized successfully).
timeout 2 npx tsx tests/test-<name>.mjsA successful run prints [TEST] SUCCESS: Reached message loop.
- Copy an existing
test-*.mjsfile - Change the exe path and any companion DLLs
- Adjust
MAX_TICKSif needed (some programs need more ticks to initialize)
Each test file:
- Creates mock Canvas/OffscreenCanvas/DOM objects
- Loads the target executable with
parsePE()+emu.load() - Calls
emu.tick()in a loop untilemu.waitingForMessageis true - Optionally inspects window hierarchy, child positions, and control state